﻿/* ADMIN LISTAS DE PRECIOS — PREMIUM DESIGN SYSTEM
   Inspirado en el sistema visual de Compras; independiente de Bootstrap.
   Scoped CSS de Blazor .NET 8. Prefijo apl-.
*/
.apl-page {
    --apl-ink: #13213b;
    --apl-muted: #64748b;
    --apl-blue: #2563eb;
    --apl-border: #dfE7f2;
    --apl-bg: #f4f8ff;
    --apl-soft: #f8fbff;
    --apl-green: #059669;
    --apl-orange: #b45309;
    --apl-shadow: 0 12px 36px rgba(19,42,82,.065);
    color: var(--apl-ink);
    min-height: 100%;
    font-family: Inter,system-ui,sans-serif;
}

    .apl-page *, .apl-page *::before, .apl-page *::after {
        box-sizing: border-box
    }

.apl-shell {
    width: min(100%,1840px);
    margin: 0 auto;
    padding: 18px 15px 46px;
    display: grid;
    gap: 15px
}

.apl-hero {
    position: relative;
    overflow: hidden;
    border-radius: 25px;
    background: linear-gradient(122deg,#10254d 0%,#193f83 54%,#366be1 100%);
    color: #fff;
    padding: 27px 30px;
    box-shadow: 0 24px 58px rgba(37,99,235,.19);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px
}

    .apl-hero::after {
        content: "";
        position: absolute;
        right: -120px;
        top: -210px;
        width: 480px;
        height: 480px;
        border-radius: 50%;
        background: radial-gradient(circle,rgba(191,219,254,.32),transparent 67%);
        pointer-events: none
    }

.apl-hero__copy {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 17px;
    align-items: center;
    min-width: 0
}

.apl-hero__glyph {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    font-size: 27px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.2);
    box-shadow: inset 0 1px rgba(255,255,255,.2);
    flex-shrink: 0
}

.apl-eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-weight: 850;
    color: #2563eb
}

.apl-eyebrow--light {
    color: #bed7ff
}

.apl-hero h1 {
    font-size: 27px;
    line-height: 1.12;
    letter-spacing: -.035em;
    margin: 5px 0 8px;
    font-weight: 850;
    color: #fff
}

.apl-hero p {
    margin: 0;
    color: #d7e5ff;
    font-size: 12px;
    line-height: 1.6;
    max-width: 590px
}

.apl-hero__actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.apl-hero__status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 750;
    font-size: 11px;
    color: #e9f2ff;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.17);
    padding: 10px 12px;
    border-radius: 12px
}

.apl-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6ee7b7;
    box-shadow: 0 0 0 4px rgba(110,231,183,.15)
}

.apl-panel {
    background: linear-gradient(180deg,#fff,#fcfdff);
    border: 1px solid var(--apl-border);
    border-radius: 20px;
    box-shadow: var(--apl-shadow);
    min-width: 0;
    overflow: hidden
}

.apl-panel__head {
    padding: 18px 20px;
    border-bottom: 1px solid #eaf0f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px
}

    .apl-panel__head h2 {
        font-size: 15px;
        font-weight: 800;
        letter-spacing: -.02em;
        margin: 4px 0 0;
        color: #172541
    }

    .apl-panel__head p {
        font-size: 11px;
        color: #94a3b8;
        margin: 4px 0 0
    }

.apl-panel__body {
    padding: 18px 20px
}

.apl-grid {
    display: grid;
    grid-template-columns: repeat(12,minmax(0,1fr));
    gap: 12px;
    align-items: end
}

.apl-field {
    grid-column: span 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0
}

.apl-field--4 {
    grid-column: span 4
}

.apl-field--5 {
    grid-column: span 5
}

.apl-field--6 {
    grid-column: span 6
}

.apl-field--2 {
    grid-column: span 2
}

.apl-field--1 {
    grid-column: span 1
}

.apl-field label {
    color: #54657f;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 800
}

.apl-control {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    border: 1px solid #d9e3f0;
    background: #fff;
    color: #172541;
    border-radius: 11px;
    padding: 0 12px;
    font: inherit;
    font-size: 12px;
    outline: 0;
    transition: border-color .18s,box-shadow .18s
}

    .apl-control:hover {
        border-color: #b9cbe3
    }

    .apl-control:focus {
        border-color: #78a9ff;
        box-shadow: 0 0 0 4px rgba(59,130,246,.1)
    }

    .apl-control:disabled {
        color: #94a3b8;
        background: #f6f8fc
    }

.apl-control--sm {
    min-height: 34px;
    padding: 0 8px;
    font-size: 11px
}

.apl-control--money {
    text-align: right;
    font-variant-numeric: tabular-nums
}

.apl-check {
    width: 50px;
    height: 17px;
    accent-color: #2563eb;
    cursor: pointer
}

.apl-checkbox-field {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    border: 1px solid #e3eaf4;
    border-radius: 11px;
    background: #f8fbff;
    font-size: 12px;
    color: #475569
}

.apl-btn {
    border: 1px solid #dce6f2;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 15px;
    min-height: 39px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-weight: 750;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .18s,background .18s,box-shadow .18s,border-color .18s;
    text-decoration: none
}

    .apl-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        background: #f8fbff;
        border-color: #bbd1ed;
        box-shadow: 0 6px 15px rgba(19,42,82,.065)
    }

    .apl-btn:disabled {
        opacity: .45;
        cursor: not-allowed;
        transform: none
    }

    .apl-btn:focus-visible {
        outline: 3px solid #93c5fd;
        outline-offset: 2px
    }

.apl-btn--primary {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg,#3b82f6,#1d4ed8);
    box-shadow: 0 8px 19px rgba(37,99,235,.17)
}

    .apl-btn--primary:hover:not(:disabled) {
        background: linear-gradient(135deg,#2563eb,#1e40af);
        box-shadow: 0 12px 24px rgba(37,99,235,.22)
    }

.apl-btn--hero {
    background: #fff;
    color: #1d4ed8;
    border: 0
}

    .apl-btn--hero:hover:not(:disabled) {
        background: #eff6ff
    }

.apl-btn--sm {
    min-height: 31px;
    padding: 0 10px;
    font-size: 10px;
    border-radius: 9px
}

.apl-btn--success {
    color: #047857;
    border-color: #a7f3d0;
    background: #f0fdf4
}

.apl-btn--danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff7f7
}

.apl-btn--dark {
    color: #fff;
    background: #192841;
    border: 0
}

    .apl-btn--dark:hover:not(:disabled) {
        background: #263c5f
    }

.apl-btn--block {
    width: 100%
}

.apl-alert {
    padding: 12px 16px;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid
}

.apl-alert--error {
    background: #fff5f5;
    color: #b91c1c;
    border-color: #fecaca
}

.apl-alert--success {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0
}

.apl-summary {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 11px
}

.apl-stat {
    border: 1px solid #e1e9f4;
    background: linear-gradient(145deg,#fff,#f7faff);
    border-radius: 16px;
    padding: 16px 17px;
    min-height: 92px;
    box-shadow: 0 4px 15px rgba(19,42,82,.035)
}

.apl-stat__label {
    color: #71829b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em
}

.apl-stat__value {
    font-size: 23px;
    font-weight: 850;
    letter-spacing: -.04em;
    margin-top: 8px;
    line-height: 1.1;
    color: #1b3053;
    font-variant-numeric: tabular-nums
}

.apl-stat__foot {
    color: #94a3b8;
    font-size: 10px;
    margin-top: 5px
}

.apl-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #eaf0f8
}

.apl-bar__group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px
}

.apl-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eef5ff;
    border: 1px solid #d8e7ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    padding: 6px 9px;
    border-radius: 999px;
    white-space: nowrap
}

.apl-chip--green {
    background: #ecfdf5;
    color: #047857;
    border-color: #bbf7d0
}

.apl-chip--amber {
    background: #fffbeb;
    color: #a16207;
    border-color: #fde68a
}

.apl-chip--neutral {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0
}

.apl-tools {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: minmax(240px,1.4fr) minmax(130px,.4fr) minmax(140px,.5fr);
    gap: 10px;
    align-items: end;
    border-bottom: 1px solid #edf2f7
}

.apl-bulk {
    padding: 14px 20px;
    display: grid;
    grid-template-columns: minmax(220px,2fr) minmax(125px,.6fr) auto auto;
    gap: 10px;
    align-items: end;
    background: #f9fbff;
    border-bottom: 1px solid #eaf0f8
}

.apl-scroll {
    max-height: min(73vh,850px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #c4d2e6 transparent
}

.apl-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 1680px;
    background: #fff;
    font-size: 11px;
    color: #334155
}

    .apl-table th, .apl-table td {
        padding: 10px 9px;
        border-bottom: 1px solid #ecf1f7;
        vertical-align: middle
    }

    .apl-table th {
        position: sticky;
        top: 0;
        z-index: 2;
        white-space: nowrap;
        text-align: left;
        background: linear-gradient(180deg,#f9fbff,#f0f5fb);
        color: #62738e;
        font-weight: 850;
        font-size: 9px;
        letter-spacing: .055em;
        text-transform: uppercase;
        border-bottom: 1px solid #dce6f3
    }

    .apl-table tbody tr:hover td {
        background: #f8fbff
    }

    .apl-table tbody tr:nth-child(even) td {
        background: #fdfefe
    }

    .apl-table tbody tr:nth-child(even):hover td {
        background: #f8fbff
    }

.apl-number {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums
}

.apl-number--strong {
    font-weight: 850;
    color: #172b4f
}

.apl-number--green {
    color: #047857;
    font-weight: 850
}

.apl-number--danger {
    color: #dc2626;
    font-weight: 850
}

.apl-thumb {
    height: 49px;
    width: 49px;
    object-fit: contain;
    border: 1px solid #e1e9f3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15,23,42,.04)
}

.apl-product {
    min-width: 205px;
    max-width: 315px
}

.apl-product__code {
    font-weight: 850;
    font-size: 11px;
    color: #1d3559
}

.apl-product__name {
    color: #687990;
    font-size: 10px;
    line-height: 1.45;
    margin-top: 4px;
    max-width: 280px;
    white-space: normal
}

.apl-product__flags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 5px
}

.apl-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 180px
}

.apl-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: #71829b;
    font-size: 11px
}

.apl-history {
    margin: 16px 20px 8px;
    border: 1px solid #d8e5f6;
    border-radius: 15px;
    overflow: hidden;
    background: #fff
}

.apl-history__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 9px;
    padding: 13px 15px;
    background: #f1f6ff
}

    .apl-history__top h3 {
        margin: 0;
        font-size: 13px;
        color: #1b3157
    }

.apl-history .apl-table {
    min-width: 780px
}

.apl-empty {
    padding: 54px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px
}

    .apl-empty strong {
        display: block;
        color: #334155;
        margin: 5px 0
    }

.apl-help {
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 3px 0 0
}

@media(max-width:1200px) {
    .apl-field {
        grid-column: span 4
    }

    .apl-field--1, .apl-field--2 {
        grid-column: span 2
    }

    .apl-bulk {
        grid-template-columns: 1fr 160px 1fr 1fr
    }

    .apl-summary {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }
}

@media(max-width:850px) {
    .apl-hero {
        padding: 20px;
        align-items: flex-start;
        flex-direction: column
    }

    .apl-tools {
        grid-template-columns: 1fr 1fr
    }

    .apl-bulk {
        grid-template-columns: 1fr 1fr
    }

    .apl-grid .apl-field {
        grid-column: span 6
    }

    .apl-field--1, .apl-field--2 {
        grid-column: span 3
    }

    .apl-hero h1 {
        font-size: 22px
    }
}

@media(max-width:550px) {
    .apl-shell {
        padding: 11px 9px 28px;
        gap: 10px
    }

    .apl-hero {
        border-radius: 17px
    }

    .apl-hero__glyph {
        width: 46px;
        height: 46px;
        font-size: 20px
    }

    .apl-panel {
        border-radius: 16px
    }

    .apl-panel__head, .apl-panel__body, .apl-bar, .apl-tools, .apl-bulk, .apl-footer {
        padding: 13px
    }

    .apl-grid .apl-field, .apl-field--1, .apl-field--2 {
        grid-column: span 12
    }

    .apl-summary {
        gap: 7px
    }

    .apl-stat {
        padding: 12px;
        min-height: 80px
    }

    .apl-stat__value {
        font-size: 18px
    }

    .apl-tools, .apl-bulk {
        grid-template-columns: 1fr
    }

    .apl-footer {
        flex-wrap: wrap
    }

    .apl-bar__group {
        width: 100%
    }
}

@media(prefers-reduced-motion:reduce) {
    .apl-page *, .apl-page *::before, .apl-page *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important
    }
}

/* ================================================================
   WORKSPACE V2 — UX compacta y modales (sin JavaScript)
   ================================================================ */
.apl-shell {
    gap: 10px;
    padding-top: 12px;
}

.apl-hero {
    min-height: 104px;
    padding: 18px 23px;
    border-radius: 19px;
}

.apl-hero__glyph {
    width: 49px;
    height: 49px;
    border-radius: 15px;
    font-size: 22px;
}

.apl-hero h1 {
    font-size: 22px;
    margin: 3px 0 5px;
}

.apl-hero p {
    font-size: 11px;
    max-width: 670px;
}

.apl-btn--hero-primary {
    color: #153c81;
    background: #fff;
    border: 1px solid rgba(255,255,255,.45);
    font-size: 11px;
}

    .apl-btn--hero-primary:hover:not(:disabled) {
        color: #1d4ed8;
        background: #eff6ff;
    }

.apl-category-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 15px;
    background: #fff;
    border: 1px solid #dce6f4;
    box-shadow: 0 5px 18px rgba(19,42,82,.045);
}

.apl-category-bar__lead {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 6px;
}

    .apl-category-bar__lead strong {
        display: block;
        font-size: 12px;
        color: #172b4f;
    }

.apl-category-bar__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 20px;
}

.apl-category-bar__select {
    width: clamp(225px, 29vw, 420px);
    flex: 1 1 225px;
    max-width: 420px;
}

.apl-category-bar__hint {
    font-size: 11px;
    color: #94a3b8;
}

.apl-chip--blue {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.apl-summary {
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 8px;
}

.apl-stat {
    min-height: 62px;
    padding: 10px 13px;
    border-radius: 13px;
    display: grid;
    gap: 1px;
    align-content: center;
    box-shadow: 0 2px 9px rgba(19,42,82,.025);
}

.apl-stat__label {
    font-size: 9px;
    letter-spacing: .035em;
}

.apl-stat__value {
    margin-top: 3px;
    font-size: 18px;
}

.apl-stat__foot {
    display: none;
}

.apl-catalog__header {
    padding: 13px 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #e9eff8;
}

    .apl-catalog__header h2 {
        color: #172b4f;
        font-size: 15px;
        margin: 3px 0 2px;
        font-weight: 850;
    }

    .apl-catalog__header p {
        font-size: 10px;
        color: #93a2b8;
        margin: 0;
    }

.apl-search-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #edf2f8;
}

.apl-search-box {
    min-width: 220px;
    flex: 1 1 240px;
    min-height: 37px;
    border: 1px solid #dbe4f1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    background: #fff;
    color: #94a3b8;
}

    .apl-search-box:focus-within {
        border-color: #93c5fd;
        box-shadow: 0 0 0 3px rgba(59,130,246,.08);
    }

.apl-search-box__input {
    background: transparent;
    border: none;
    outline: none;
    font: inherit;
    font-size: 12px;
    color: #172b4f;
    flex: 1;
    width: 100%;
    min-width: 0;
}

.apl-search-row .apl-btn {
    min-height: 35px;
}

.apl-search-row__count {
    color: #8594aa;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.apl-inline-check {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #526580;
    white-space: nowrap;
    cursor: pointer;
}

    .apl-inline-check .apl-check {
        width: 15px;
        height: 15px;
    }

.apl-table-meta {
    padding: 7px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fbfdff;
    font-size: 10px;
    color: #8492a6;
    border-bottom: 1px solid #e9eff7;
}

.apl-table-meta__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.apl-table-meta .apl-chip {
    padding: 3px 7px;
    font-size: 9px;
}

.apl-bulk--active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    animation: aplReveal .2s ease-out;
}

.apl-bulk__count {
    white-space: nowrap;
    font-size: 11px;
    color: #1e40af;
    font-weight: 850;
}

.apl-bulk__reason {
    flex: 1 1 245px;
    min-width: 150px;
}

.apl-bulk__margin {
    display: flex;
    gap: 7px;
    align-items: center;
}

    .apl-bulk__margin label {
        white-space: nowrap;
        color: #526580;
        font-size: 10px;
        font-weight: 800;
    }

    .apl-bulk__margin .apl-control {
        width: 90px;
    }

.apl-bulk--active .apl-control, .apl-bulk--active .apl-btn {
    min-height: 35px;
}

.apl-table {
    min-width: 1080px;
}

    .apl-table th, .apl-table td {
        padding: 8px;
    }

    .apl-table th {
        font-size: 9px;
    }

.apl-product {
    min-width: 175px;
}

.apl-scroll {
    max-height: min(66vh, 760px);
}

.apl-footer {
    padding: 10px 16px;
}

.apl-modal-overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(10,25,50,.59);
    backdrop-filter: blur(5px);
    animation: aplReveal .16s ease-out;
}

.apl-modal {
    width: min(100%, 520px);
    max-height: min(90vh, 850px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(226,236,251,.9);
    border-radius: 22px;
    box-shadow: 0 35px 110px rgba(4,18,48,.36);
    animation: aplPop .25s cubic-bezier(.16,1,.3,1);
}

.apl-modal--wide {
    width: min(100%, 1060px);
}

.apl-modal__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 23px 25px 18px;
    border-bottom: 1px solid #edf2f8;
    background: radial-gradient(circle at 100% 0%,rgba(59,130,246,.08),transparent 40%),#fff;
}

    .apl-modal__header h2 {
        margin: 5px 0;
        color: #132744;
        font-size: 21px;
        letter-spacing: -.04em;
    }

    .apl-modal__header p {
        margin: 0;
        color: #8291a8;
        font-size: 11px;
        line-height: 1.55;
    }

.apl-modal__close {
    border: 1px solid #dfe8f4;
    border-radius: 10px;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    font: inherit;
}

    .apl-modal__close:hover:not(:disabled) {
        background: #f1f5f9;
        color: #1e293b;
    }

.apl-modal__body {
    padding: 22px 25px;
    overflow-y: auto;
    display: grid;
    gap: 16px;
}

.apl-modal__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.apl-modal__formula {
    margin: 0;
    color: #476289;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 11px;
}

.apl-modal__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 9px;
    padding: 15px 25px;
    border-top: 1px solid #edf2f8;
    background: #fcfdff;
}

.apl-scroll--history {
    max-height: 60vh;
}

    .apl-scroll--history .apl-table {
        min-width: 820px;
    }

@keyframes aplReveal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes aplPop {
    from {
        transform: translateY(10px) scale(.985);
        opacity: .4;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .apl-catalog__header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .apl-table-meta__tip {
        display: none;
    }

    .apl-category-bar__select {
        max-width: none;
    }

    .apl-search-row__count {
        display: none;
    }
}

@media (max-width: 600px) {
    .apl-hero {
        gap: 12px;
        padding: 17px;
    }

    .apl-hero__actions {
        width: 100%;
    }

        .apl-hero__actions .apl-btn {
            flex: 1;
        }

    .apl-summary {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .apl-stat {
        min-height: 56px;
    }

    .apl-category-bar {
        padding: 10px;
    }

    .apl-category-bar__lead {
        width: 100%;
    }

    .apl-search-box {
        flex-basis: 100%;
    }

    .apl-modal__header {
        padding: 18px;
    }

    .apl-modal__body {
        padding: 18px;
    }

    .apl-modal__footer {
        padding: 13px 18px;
    }

    .apl-modal__fields {
        grid-template-columns: 1fr;
    }

    .apl-bulk__reason {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .apl-modal, .apl-modal-overlay, .apl-bulk--active {
        animation: none;
    }
}


/* ================================================================
   SELECTOR JERÁRQUICO PREMIUM EN MODAL
   Prefijo apl- para no afectar el módulo de listas original.
   ================================================================ */
.apl-classification-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border: 1px solid #dbe7f7;
    border-radius: 15px;
    background: linear-gradient(110deg, #ffffff 0%, #f6faff 100%);
    box-shadow: 0 6px 20px rgba(24, 49, 87, .045);
}

.apl-classification-bar__identity,
.apl-classification-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.apl-classification-bar__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.apl-classification-bar__icon {
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #e5f0ff, #eef2ff);
    color: #2563eb;
    font-size: 23px;
}

.apl-classification-bar__copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

    .apl-classification-bar__copy strong {
        color: #17315b;
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .apl-classification-bar__copy small {
        color: #8191a8;
        font-size: 11px;
    }

.apl-classification-bar__open {
    min-height: 38px;
}

.apl-modal--hierarchy {
    width: min(96vw, 900px);
    max-height: min(90vh, 850px);
}

.apl-hierarchy-modal__hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 25px;
    color: #fff;
    background: linear-gradient(115deg, #102855 0%, #1c438b 56%, #3266bd 100%);
    position: relative;
    overflow: hidden;
}

    .apl-hierarchy-modal__hero::after {
        content: "";
        position: absolute;
        width: 280px;
        height: 280px;
        right: -90px;
        top: -200px;
        pointer-events: none;
        background: radial-gradient(circle, rgba(255,255,255,.19), transparent 70%);
    }

.apl-hierarchy-modal__heading {
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.apl-hierarchy-modal__glyph {
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    flex: 0 0 49px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.13);
    font-size: 24px;
}

.apl-hierarchy-modal__heading h2 {
    margin: 3px 0 5px;
    font-size: 21px;
    font-weight: 850;
    color: #fff;
    letter-spacing: -.025em;
}

.apl-hierarchy-modal__heading p {
    margin: 0;
    color: rgba(255,255,255,.76);
    font-size: 11px;
}

.apl-hierarchy-modal__close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    background: rgba(255,255,255,.1);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

    .apl-hierarchy-modal__close:hover {
        background: rgba(255,255,255,.2);
    }

.apl-hierarchy-modal__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    background: #f9fbff;
    border-bottom: 1px solid #e7eef8;
}

.apl-hierarchy-modal__search {
    flex: 1;
    min-width: 0;
}

.apl-hierarchy-modal__content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 22px 22px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #cad8e9 transparent;
}

.apl-hierarchy-modal__all,
.apl-hierarchy-modal__result {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 11px 13px;
    margin-bottom: 8px;
    border: 1px solid #e0e8f4;
    border-radius: 13px;
    background: #fff;
    color: #243750;
    cursor: pointer;
    transition: border-color .17s, box-shadow .17s, background .17s;
    font: inherit;
}

    .apl-hierarchy-modal__all:hover,
    .apl-hierarchy-modal__result:hover {
        background: #f8fbff;
        border-color: #a9caf8;
        box-shadow: 0 5px 15px rgba(31, 66, 119, .05);
    }

    .apl-hierarchy-modal__all.is-active,
    .apl-hierarchy-modal__result.is-active {
        background: #eff6ff;
        border-color: #93c5fd;
    }

.apl-hierarchy-modal__all-icon,
.apl-hierarchy-modal__result-icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eaf2ff;
    color: #2563eb;
    font-size: 17px;
}

.apl-hierarchy-modal__all strong,
.apl-hierarchy-modal__result-main strong {
    display: block;
    font-size: 12px;
    color: #1c355c;
}

.apl-hierarchy-modal__all small,
.apl-hierarchy-modal__result-main small {
    display: block;
    margin-top: 3px;
    color: #8797ad;
    font-size: 10px;
}

.apl-hierarchy-modal__choose,
.apl-hierarchy-modal__result-arrow {
    margin-left: auto;
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.apl-hierarchy-modal__result-main {
    flex: 1;
    min-width: 0;
}

    .apl-hierarchy-modal__result-main small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.apl-hierarchy-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 22px;
    background: #fbfdff;
    border-top: 1px solid #e6edf7;
}

    .apl-hierarchy-modal__footer span {
        font-size: 11px;
        color: #8493aa;
    }
/* Tarjetas del árbol: un estilo inspirado en la estructura pl-node-card. */
.apl-modal--hierarchy .apl-tree-item {
    min-width: 0;
}

.apl-modal--hierarchy .apl-tree-row {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .025);
    transition: background .17s, border-color .17s, box-shadow .17s;
}

    .apl-modal--hierarchy .apl-tree-row:hover {
        background: #f8fbff;
        border-color: #bfdbfe;
        box-shadow: 0 5px 12px rgba(15,23,42,.04);
    }

    .apl-modal--hierarchy .apl-tree-row.is-active {
        background: #eff6ff;
        border-color: #60a5fa;
    }

.apl-modal--hierarchy .apl-tree-chevron {
    display: grid;
    place-items: center;
    flex: 0 0 27px;
    width: 27px;
    height: 31px;
    padding: 0;
    color: #657a9c;
    background: #f7faff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 19px;
}

    .apl-modal--hierarchy .apl-tree-chevron:hover {
        background: #e8f1ff;
        color: #2563eb;
    }

.apl-modal--hierarchy .apl-tree-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
    padding: 7px 4px;
    color: #263c5b;
    text-align: left;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.apl-modal--hierarchy .apl-tree-name {
    min-width: 0;
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apl-modal--hierarchy .apl-tree-count {
    padding: 4px 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.apl-modal--hierarchy .apl-tree-children {
    margin: 0 0 6px 22px;
    padding-left: 19px;
    border-left: 1px dashed #bfcfe3;
}

@media (max-width: 760px) {
    .apl-classification-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .apl-classification-bar__actions, .apl-classification-bar__open {
        width: 100%;
    }

        .apl-classification-bar__actions .apl-btn {
            flex: 1;
        }

    .apl-modal--hierarchy {
        width: min(100%, 900px);
    }

    .apl-hierarchy-modal__hero {
        padding: 17px;
    }

    .apl-hierarchy-modal__heading h2 {
        font-size: 17px;
    }

    .apl-hierarchy-modal__heading p {
        line-height: 1.45;
    }

    .apl-hierarchy-modal__toolbar {
        flex-wrap: wrap;
        padding: 12px 15px;
    }

    .apl-hierarchy-modal__content {
        padding: 12px 14px;
    }

    .apl-hierarchy-modal__footer {
        padding: 11px 14px;
    }

        .apl-hierarchy-modal__footer span {
            display: none;
        }
}

@media (prefers-reduced-motion: reduce) {
    .apl-modal--hierarchy, .apl-modal--hierarchy * {
        scroll-behavior: auto;
    }
}

/* ================================================================
   SELECTOR COMERCIAL · PREMIUM 2.0
   Un solo modal, sin fuentes de iconos ni dependencias externas.
   ================================================================ */
.apl-modal--hierarchy {
    width: min(95vw,1040px);
    max-height: min(91vh,900px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 38px 110px rgba(9,30,66,.31);
}

.apl-hierarchy-modal__hero {
    padding: 27px 31px;
    background: linear-gradient(112deg,#0b1b38 0%,#173e7a 52%,#2669c9 100%);
}

    .apl-hierarchy-modal__hero::after {
        width: 440px;
        height: 440px;
        right: -150px;
        top: -240px;
        background: radial-gradient(circle,rgba(147,197,253,.27),transparent 69%);
    }

.apl-hierarchy-modal__heading {
    gap: 17px;
}

.apl-hierarchy-modal__glyph {
    width: 59px;
    height: 59px;
    flex-basis: 59px;
    border-radius: 18px;
    background: rgba(255,255,255,.13);
    box-shadow: 0 10px 30px rgba(8,25,56,.2);
}

.apl-hierarchy-modal__heading h2 {
    font-size: clamp(19px,2.5vw,26px);
    letter-spacing: -.035em;
}

.apl-hierarchy-modal__heading p {
    font-size: 12px;
    line-height: 1.6;
}

.apl-hierarchy-modal__close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.apl-hierarchy-modal__toolbar {
    padding: 18px 28px;
    gap: 14px;
    background: #f7faff;
}

.apl-hierarchy-modal__search {
    min-height: 47px;
    border-radius: 13px;
    background: #fff;
    border: 1px solid #dae6f5;
    box-shadow: 0 2px 7px rgba(15,35,68,.03);
}

.apl-hierarchy-search-icon {
    display: flex;
    align-items: center;
    color: #6c86a9;
}

.apl-hierarchy-modal__content {
    padding: 22px 28px 25px;
    background: linear-gradient(180deg,#fbfdff 0%,#fff 25%);
}

.apl-hierarchy-modal__all, .apl-hierarchy-modal__result {
    min-height: 68px;
    padding: 13px 17px;
    border-radius: 15px;
    margin-bottom: 11px;
    border: 1px solid #e1e9f4;
    box-shadow: 0 2px 8px rgba(15,40,72,.025);
}

    .apl-hierarchy-modal__all:hover, .apl-hierarchy-modal__result:hover {
        transform: translateY(-1px);
        border-color: #94bdf6;
        box-shadow: 0 9px 24px rgba(37,99,235,.09);
    }

.apl-hierarchy-modal__all-icon, .apl-hierarchy-modal__result-icon {
    flex-basis: 45px;
    width: 45px;
    height: 45px;
    border-radius: 13px;
    background: linear-gradient(135deg,#e7f0ff,#d9e9ff);
}

.apl-hierarchy-modal__all strong, .apl-hierarchy-modal__result-main strong {
    font-size: 13px;
    font-weight: 800;
}

.apl-hierarchy-modal__all small, .apl-hierarchy-modal__result-main small {
    font-size: 11px;
    line-height: 1.4;
}

.apl-hierarchy-modal__footer {
    padding: 16px 28px;
    background: #f7faff;
}

    .apl-hierarchy-modal__footer span {
        font-size: 12px;
    }

.apl-modal--hierarchy .apl-tree-row {
    min-height: 60px;
    padding: 6px 8px;
    gap: 7px;
    margin-bottom: 9px;
    border-radius: 14px;
    border-color: #e2e9f3;
    box-shadow: 0 2px 8px rgba(14,38,76,.025);
}

    .apl-modal--hierarchy .apl-tree-row:hover {
        background: #f7faff;
        border-color: #9fc3f5;
        box-shadow: 0 8px 24px rgba(26,75,142,.08);
    }

    .apl-modal--hierarchy .apl-tree-row.is-active {
        border-color: #5b9af4;
        background: #eef5ff;
        box-shadow: inset 0 0 0 1px rgba(59,130,246,.12);
    }

.apl-modal--hierarchy .apl-tree-chevron {
    width: 37px;
    height: 40px;
    flex-basis: 37px;
    border-radius: 10px;
    transition: background .2s,color .2s;
}

    .apl-modal--hierarchy .apl-tree-chevron svg {
        transition: transform .2s;
    }

    .apl-modal--hierarchy .apl-tree-chevron.is-expanded svg {
        transform: rotate(90deg);
    }

.apl-modal--hierarchy .apl-tree-chevron--empty {
    background: transparent;
    cursor: default;
}

.apl-modal--hierarchy .apl-tree-link {
    gap: 12px;
    min-height: 47px;
    padding: 4px 10px 4px 2px;
}

.apl-tree-node-icon {
    display: grid;
    place-items: center;
    flex: 0 0 41px;
    width: 41px;
    height: 41px;
    border-radius: 12px;
    background: #e8f1ff;
    color: #2563eb;
}

.apl-tree-node-icon--2 {
    background: #e9f8ff;
    color: #0891b2;
}

.apl-tree-node-icon--3 {
    background: #f1edff;
    color: #7c3aed;
}

.apl-tree-node-icon--4, .apl-tree-node-icon--5, .apl-tree-node-icon--6 {
    background: #eff8f3;
    color: #059669;
}

.apl-tree-copy {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.apl-modal--hierarchy .apl-tree-name {
    display: block;
    font-size: 13px;
    line-height: 1.25;
}

.apl-tree-caption {
    color: #8c9bb0;
    font-size: 10px;
    letter-spacing: .02em;
}

.apl-modal--hierarchy .apl-tree-count {
    font-size: 10px;
    flex-shrink: 0;
    padding: 6px 10px;
    background: #edf4ff;
}

.apl-tree-select-icon {
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    color: #9aabc2;
}

.apl-tree-row.is-active .apl-tree-select-icon {
    color: #2563eb;
}

.apl-modal--hierarchy .apl-tree-children {
    margin-left: 22px;
    padding-left: 21px;
    border-left: 2px solid #e5edf8;
}

.apl-vector-icon {
    display: block;
    flex-shrink: 0;
}

.apl-modal--hierarchy button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

@media(max-width:760px) {
    .apl-modal--hierarchy {
        border-radius: 17px;
        max-height: 94vh;
    }

    .apl-hierarchy-modal__hero {
        padding: 19px 16px;
    }

    .apl-hierarchy-modal__glyph {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 13px;
    }

    .apl-hierarchy-modal__toolbar {
        padding: 12px 14px;
    }

    .apl-hierarchy-modal__content {
        padding: 13px 11px;
    }

    .apl-modal--hierarchy .apl-tree-row {
        gap: 4px;
    }

    .apl-modal--hierarchy .apl-tree-link {
        gap: 7px;
    }

    .apl-modal--hierarchy .apl-tree-chevron {
        width: 26px;
        flex-basis: 26px;
    }

    .apl-tree-node-icon {
        width: 33px;
        height: 33px;
        flex-basis: 33px;
    }

    .apl-modal--hierarchy .apl-tree-count span {
        display: none;
    }

    .apl-modal--hierarchy .apl-tree-children {
        margin-left: 10px;
        padding-left: 9px;
    }

    .apl-tree-caption {
        font-size: 9px;
    }

    .apl-hierarchy-modal__footer {
        padding: 12px 15px;
    }
}

@media(prefers-reduced-motion:reduce) {
    .apl-modal--hierarchy * {
        transition: none !important;
        animation: none !important;
    }
}


/* ==========================================================
   AGRUPACIÓN POR RUTA COMERCIAL — tarjetas dentro de la tabla
   ========================================================== */
.apl-group-head > td {
    padding: 0 !important;
    background: #eef4fc !important;
    border-bottom: 1px solid #dbe7f5 !important;
}

.apl-group-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    padding: 13px 18px;
    border: 0;
    color: #214471;
    background: linear-gradient(90deg, #eef5ff, #f8fbff);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

    .apl-group-toggle:hover {
        background: #e7f0ff;
    }

    .apl-group-toggle:focus-visible {
        outline: 3px solid #60a5fa;
        outline-offset: -3px;
    }

.apl-group-toggle__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 3px;
}

    .apl-group-toggle__body strong {
        font-size: 12px;
        font-weight: 800;
        color: #173b6b;
    }

    .apl-group-toggle__body small {
        font-size: 10px;
        font-weight: 500;
        color: #64748b;
        white-space: normal;
    }

.apl-group-count {
    color: #1e40af;
    font-size: 10px;
    font-weight: 800;
    background: white;
    border: 1px solid #d5e4fc;
    border-radius: 999px;
    padding: 5px 9px;
}

.apl-group-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.apl-product__path {
    margin-top: 5px;
    color: #6182b2;
    font-size: 9px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (max-width: 740px) {
    .apl-group-toggle {
        padding: 11px 12px;
        gap: 7px;
    }

    .apl-group-toggle__body small {
        font-size: 9px;
    }

    .apl-group-count {
        white-space: nowrap;
    }
}


/* =============================================================
   SELECCIÓN POR NODO Y MODAL DE EDICIÓN MASIVA — PREMIUM
   ============================================================= */
.apl-insights-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px
}

.apl-insights-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid #dae5f4;
    border-radius: 999px;
    background: #f5f9ff;
    color: #627590;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap
}

    .apl-insights-pill svg {
        color: #5386ca;
        flex-shrink: 0
    }

    .apl-insights-pill strong {
        color: #15396d;
        font-size: 12px;
        font-variant-numeric: tabular-nums
    }

.apl-insights-pill--selected {
    background: #e8f1ff;
    border-color: #9fc3fa;
    color: #1d4ed8
}

.apl-group-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0
}

.apl-group-select {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d5e4f5;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    color: #547196;
    font-size: 11px;
    font-weight: 800
}

    .apl-group-select:hover {
        border-color: #93baf5;
        background: #f5f9ff
    }

.apl-group-row .apl-group-toggle {
    flex: 1;
    min-width: 0
}

.apl-group-picked {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    white-space: nowrap
}

.apl-selection-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 17px;
    border: 1px solid #a8c8fc;
    background: linear-gradient(120deg,#eef5ff,#f8fbff);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(29,78,216,.08);
    flex-wrap: wrap
}

.apl-selection-action__info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #163866
}

    .apl-selection-action__info > span:last-child {
        display: grid;
        gap: 3px
    }

    .apl-selection-action__info strong {
        font-size: 14px
    }

    .apl-selection-action__info small {
        font-size: 11px;
        color: #6882a5
    }

.apl-selection-action__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg,#2563eb,#6366f1)
}

.apl-selection-action__buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.apl-selection-action__cta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 43px;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(37,99,235,.19)
}

.apl-modal--bulk {
    width: min(95vw,1140px);
    max-height: 92vh
}

.apl-bulk-modal__hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 24px 27px;
    background: linear-gradient(115deg,#12366e,#1d4b92 65%,#4157ad);
    color: #fff
}

.apl-bulk-modal__title {
    display: flex;
    align-items: center;
    gap: 16px
}

.apl-bulk-modal__symbol {
    width: 53px;
    height: 53px;
    display: grid;
    place-items: center;
    border: 1px solid #ffffff45;
    background: #ffffff18;
    border-radius: 16px;
    flex-shrink: 0
}

.apl-bulk-modal__hero h2 {
    color: #fff;
    font-size: 22px;
    letter-spacing: -.02em;
    margin: 5px 0
}

.apl-bulk-modal__hero p {
    color: #dbeafe;
    font-size: 12px;
    margin: 0
}

.apl-bulk-modal__close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    background: #ffffff19;
    border: 1px solid #ffffff3a;
    border-radius: 11px;
    cursor: pointer
}

.apl-bulk-modal__content {
    padding: 19px 23px;
    overflow-y: auto;
    min-height: 0
}

.apl-bulk-modal__stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px
}

    .apl-bulk-modal__stats > span {
        padding: 7px 12px;
        background: #eff5ff;
        border: 1px solid #dbe7f8;
        border-radius: 999px;
        color: #587291;
        font-size: 11px
    }

    .apl-bulk-modal__stats strong {
        color: #1b4a86
    }

.apl-bulk-modal__layout {
    display: grid;
    grid-template-columns: minmax(0,1.2fr) minmax(315px,.8fr);
    gap: 18px;
    align-items: start
}

.apl-bulk-modal__preview, .apl-bulk-modal__settings {
    border: 1px solid #e0e9f5;
    border-radius: 17px;
    padding: 16px;
    background: #fff;
    min-width: 0;
    display: grid;
    gap: 12px
}

.apl-bulk-modal__settings {
    background: #fafcff
}

.apl-bulk-modal__section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px
}

    .apl-bulk-modal__section-title h3 {
        font-size: 14px;
        margin: 0 0 4px;
        color: #1c3760
    }

    .apl-bulk-modal__section-title small {
        font-size: 11px;
        color: #8190a6
    }

.apl-bulk-modal__search {
    width: 100%
}

.apl-bulk-modal__products {
    max-height: 43vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    align-content: start;
    gap: 12px;
    padding-right: 4px
}

.apl-bulk-modal__group {
    border: 1px solid #e5ebf4;
    border-radius: 12px;
    overflow: hidden
}

.apl-bulk-modal__group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #eff5ff;
    color: #254e85;
    font-size: 11px
}

    .apl-bulk-modal__group-head strong {
        flex: 1;
        min-width: 0;
        overflow-wrap: anywhere
    }

    .apl-bulk-modal__group-head span {
        background: #dbeafe;
        border-radius: 999px;
        padding: 3px 7px
    }

.apl-bulk-modal__product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-top: 1px solid #edf1f7
}

    .apl-bulk-modal__product img {
        width: 36px;
        height: 36px;
        object-fit: contain;
        background: #f8fafc;
        border: 1px solid #e5ebf3;
        border-radius: 8px
    }

.apl-bulk-modal__product-text {
    display: grid;
    gap: 3px;
    min-width: 0;
    flex: 1
}

    .apl-bulk-modal__product-text strong {
        font-size: 11px;
        color: #1f385a
    }

    .apl-bulk-modal__product-text small {
        font-size: 10px;
        color: #7e90a7;
        overflow-wrap: anywhere
    }

.apl-bulk-modal__current {
    font-size: 11px;
    font-weight: 750;
    color: #27609f;
    white-space: nowrap
}

.apl-bulk-modal__remove {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid #e1e7ef;
    background: white;
    border-radius: 8px;
    color: #71829b;
    cursor: pointer
}

    .apl-bulk-modal__remove:hover {
        color: #dc2626;
        border-color: #fecaca;
        background: #fff1f2
    }

.apl-bulk-modal__none {
    padding: 20px;
    color: #64748b;
    text-align: center;
    font-size: 12px
}

.apl-bulk-modal__mode {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid #e1e8f3;
    border-radius: 12px;
    background: #fff;
    cursor: pointer
}

    .apl-bulk-modal__mode.is-current {
        background: #eff6ff;
        border-color: #93bafd;
        box-shadow: 0 0 0 2px #dbeafe
    }

    .apl-bulk-modal__mode input {
        accent-color: #2563eb;
        margin-top: 3px
    }

    .apl-bulk-modal__mode span {
        display: grid;
        gap: 5px
    }

    .apl-bulk-modal__mode strong {
        color: #1d3b65;
        font-size: 12px
    }

    .apl-bulk-modal__mode small, .apl-bulk-modal__helper {
        color: #7c90a9;
        font-size: 11px
    }

.apl-bulk-modal__margin {
    width: 100%;
    font-size: 16px;
    font-weight: 750
}

.apl-bulk-modal__reason {
    width: 100%;
    min-height: 88px;
    resize: vertical
}

.apl-bulk-modal__warning {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    border: 1px solid #f5dfa7;
    border-radius: 12px;
    padding: 12px;
    background: #fffbeb;
    color: #8a610e;
    font-size: 11px;
    line-height: 1.5
}

    .apl-bulk-modal__warning svg {
        flex-shrink: 0
    }

.apl-bulk-modal__footer {
    padding: 15px 23px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #e6edf7;
    background: #fcfdff
}

    .apl-bulk-modal__footer > span {
        font-size: 11px;
        color: #8091a5
    }

    .apl-bulk-modal__footer > div {
        display: flex;
        gap: 8px
    }

.apl-bulk-modal__save {
    min-height: 40px
}

@media(max-width:850px) {
    .apl-bulk-modal__layout {
        grid-template-columns: 1fr
    }

    .apl-bulk-modal__products {
        max-height: 250px
    }

    .apl-bulk-modal__footer {
        flex-wrap: wrap
    }

    .apl-modal--bulk {
        max-height: 94vh
    }
}

@media(max-width:550px) {
    .apl-bulk-modal__hero {
        padding: 18px
    }

        .apl-bulk-modal__hero h2 {
            font-size: 17px
        }

    .apl-bulk-modal__content {
        padding: 12px
    }

    .apl-bulk-modal__footer {
        padding: 12px
    }

    .apl-group-select span {
        display: none
    }

    .apl-group-picked {
        display: none
    }

    .apl-insights-pill {
        padding: 6px 9px
    }
}

/* ==============================================================
   BARRA DE TRABAJO UNIFICADA — compacta y responsive
   La jerarquía y los indicadores ya no ocupan franjas separadas.
   ============================================================== */
.apl-search-row--unified {
    display: flex;
    align-items: center;
    column-gap: 13px;
    row-gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #fff;
}

.apl-search-row__primary,
.apl-search-row__metrics,
.apl-search-row__secondary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.apl-search-row__primary {
    flex: 0 1 auto;
}

.apl-search-row--unified .apl-search-box {
    flex: 0 1 228px;
    width: 228px;
    min-width: 160px;
    min-height: 35px;
    border-radius: 9px;
}

.apl-search-row--unified .apl-btn {
    white-space: nowrap;
    min-height: 34px;
}

.apl-toolbar-explore {
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.apl-toolbar-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 190px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.apl-toolbar-active-filter__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apl-toolbar-active-filter:hover {
    background: #dbeafe;
}

.apl-search-row__metrics {
    flex-wrap: wrap;
    gap: 5px;
}

.apl-search-row--unified .apl-insights-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    min-height: 30px;
    margin: 0;
    border-radius: 999px;
    font-size: 10px;
    white-space: nowrap;
}

    .apl-search-row--unified .apl-insights-pill strong {
        font-size: 11px;
    }

.apl-search-row__secondary {
    margin-left: auto;
    gap: 10px;
}

    .apl-search-row__secondary .apl-inline-check {
        white-space: nowrap;
        font-size: 11px;
    }

@media (max-width: 1300px) {
    .apl-search-row__secondary {
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .apl-search-row--unified {
        align-items: stretch;
        gap: 10px;
    }

    .apl-search-row__primary {
        flex-wrap: wrap;
        width: 100%;
    }

    .apl-search-row--unified .apl-search-box {
        flex: 1 1 180px;
        width: auto;
    }

    .apl-search-row__metrics {
        width: 100%;
    }

    .apl-search-row__secondary {
        flex-wrap: wrap;
    }
}

@media (max-width: 420px) {
    .apl-toolbar-explore {
        flex: 1 1 100%;
        justify-content: center;
    }

    .apl-toolbar-active-filter {
        max-width: 100%;
    }
}

/* ============================================================
   REVISIÓN MASIVA — catálogo completo desplazable.
   Evita que el primer grupo monopolice el espacio y hace visible
   el scroll de las demás clasificaciones seleccionadas.
   ============================================================ */
.apl-modal--bulk {
    height: min(92dvh, 920px);
    max-height: 92dvh;
}

.apl-bulk-modal__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.apl-bulk-modal__layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

.apl-bulk-modal__preview,
.apl-bulk-modal__settings {
    min-height: 0;
}

.apl-bulk-modal__preview {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.apl-bulk-modal__settings {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.apl-bulk-modal__list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: #627995;
}

.apl-bulk-modal__products {
    display: block;
    flex: 1 1 auto;
    min-height: 140px;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #8eb2e9 #edf3fb;
    padding: 4px 7px 4px 2px;
}

    .apl-bulk-modal__products::-webkit-scrollbar {
        width: 9px;
    }

    .apl-bulk-modal__products::-webkit-scrollbar-track {
        border-radius: 999px;
        background: #edf3fb;
    }

    .apl-bulk-modal__products::-webkit-scrollbar-thumb {
        border: 2px solid #edf3fb;
        border-radius: 999px;
        background: #8eb2e9;
    }

.apl-bulk-modal__group {
    display: block;
    margin-bottom: 11px;
}

.apl-bulk-modal__group-head {
    position: sticky;
    top: 0;
    z-index: 1;
}

.apl-bulk-modal__product {
    min-height: 54px;
}

@media (max-width: 850px) {
    .apl-modal--bulk {
        height: min(95dvh, 900px);
        max-height: 95dvh;
    }

    .apl-bulk-modal__content {
        overflow-y: auto;
    }

    .apl-bulk-modal__layout {
        display: flex;
        flex-direction: column;
        overflow: visible;
        flex: none;
    }

    .apl-bulk-modal__preview {
        min-height: 360px;
        height: min(53dvh, 500px);
        flex-shrink: 0;
    }

    .apl-bulk-modal__products {
        max-height: none;
        min-height: 0;
    }

    .apl-bulk-modal__settings {
        overflow: visible;
    }
}

/* ======================================================================
   ATELIER 2026 · PRICE INTELLIGENCE
   Capa visual final. No modifica interacciones Blazor ni reglas de negocio.
   El motivo topográfico es CSS puro, sin imágenes ni JavaScript.
   ====================================================================== */
.apl-page {
    --apl-ink: #152743;
    --apl-blue: #3659e8;
    --apl-muted: #667891;
    --apl-border: #e2eaf5;
    --apl-shadow: 0 8px 28px rgba(20, 43, 83, .045), 0 1px 2px rgba(20,43,83,.035);
    background: radial-gradient(ellipse 72% 26% at 48% -7%, rgba(90,138,244,.085),transparent 90%);
    color: var(--apl-ink);
}

.apl-shell {
    gap: 13px;
    padding-top: 16px;
}

.apl-hero {
    isolation: isolate;
    min-height: 155px;
    padding: 28px 32px;
    border-radius: 23px;
    border: 1px solid rgba(159,191,255,.28);
    background: linear-gradient(110deg,#0b1830 0%,#102a56 45%,#1d4b8a 78%,#296ab7 100%);
    box-shadow: 0 24px 45px rgba(15,49,102,.17), inset 0 1px rgba(255,255,255,.16);
}
    /* Firma gráfica: órbitas concéntricas y nodos del mapa comercial */
    .apl-hero::before {
        content: "";
        position: absolute;
        width: 540px;
        height: 540px;
        top: -226px;
        right: 7%;
        border-radius: 50%;
        opacity: .7;
        background: repeating-radial-gradient(circle, transparent 0 33px, rgba(195,218,255,.095) 34px 35px, transparent 36px 58px), radial-gradient(circle at 48% 49%,rgba(94,165,255,.18),transparent 68%);
        pointer-events: none;
        z-index: -1;
    }

    .apl-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        width: auto;
        height: auto;
        top: 0;
        right: 0;
        border-radius: inherit;
        background-image: radial-gradient(circle,rgba(204,225,255,.47) 0 1.4px,transparent 1.9px);
        background-size: 53px 48px;
        background-position: 12px 16px;
        mask-image: linear-gradient(90deg,transparent 36%,#000 100%);
        opacity: .36;
        z-index: -1;
    }

.apl-hero__glyph {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    background: linear-gradient(145deg,rgba(255,255,255,.23),rgba(255,255,255,.065));
    border: 1px solid rgba(221,238,255,.38);
    box-shadow: inset 0 1px rgba(255,255,255,.3),0 16px 28px rgba(3,19,45,.2);
}

    .apl-hero__glyph svg {
        filter: drop-shadow(0 0 10px rgba(185,224,255,.8));
    }

.apl-hero__separator {
    color: #71e4cc;
    padding: 0 5px;
}

.apl-hero .apl-eyebrow {
    color: #a9c9fe;
    letter-spacing: .15em;
}

.apl-hero h1 {
    font-size: clamp(22px,2.15vw,32px);
    font-weight: 850;
    letter-spacing: -.048em;
}

.apl-hero p {
    color: #ccdafa;
    font-size: 12px;
    max-width: 680px;
}

.apl-hero__actions .apl-btn {
    min-height: 40px;
    border-radius: 12px;
    font-size: 11px;
}

.apl-btn--hero-primary {
    background: #f5f9ff;
    color: #14386f;
    box-shadow: 0 5px 17px rgba(0,10,32,.14);
}

.apl-btn--hero {
    background: rgba(255,255,255,.105);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
}

    .apl-btn--hero:hover:not(:disabled) {
        background: rgba(255,255,255,.2);
        color: #fff;
    }

.apl-category-bar, .apl-panel {
    border-color: var(--apl-border);
    box-shadow: var(--apl-shadow);
}

.apl-category-bar {
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,.97);
}

.apl-category-bar__icon {
    border-radius: 13px;
    background: linear-gradient(140deg,#ecf3ff,#dfeaff);
}

.apl-category-bar__lead strong {
    font-size: 13px;
    letter-spacing: -.02em;
}

.apl-category-bar__select {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 650;
}

.apl-catalog {
    border-radius: 19px;
    overflow: hidden;
    background: #fff;
}

.apl-catalog__header {
    padding: 18px 23px;
    background: linear-gradient(100deg,#fff 30%,#f5f9ff 100%);
    border-bottom: 1px solid #e6edf8;
}

    .apl-catalog__header h2 {
        font-size: 18px;
        letter-spacing: -.04em;
    }

    .apl-catalog__header p {
        font-size: 11px;
        color: #71839d;
    }

.apl-search-row--unified {
    padding: 14px 18px;
    column-gap: 12px;
    row-gap: 10px;
    background: #fff;
}

    .apl-search-row--unified .apl-search-box {
        min-height: 42px;
        border-radius: 12px;
        background: #f8faff;
        border-color: #dfe9f7;
        transition: box-shadow .22s,border-color .22s,background .22s;
    }

        .apl-search-row--unified .apl-search-box:focus-within {
            background: #fff;
            box-shadow: 0 0 0 4px rgba(64,122,234,.095);
        }

    .apl-search-row--unified .apl-btn {
        min-height: 40px;
        border-radius: 11px;
    }

.apl-toolbar-explore {
    background: linear-gradient(115deg,#233b81,#3669c8);
    box-shadow: 0 5px 15px rgba(47,87,181,.18);
}

.apl-insights-pill {
    border: 1px solid #dde8f6;
    background: #f7faff;
    border-radius: 100px;
    padding: 7px 11px;
    font-size: 10px;
    color: #55708f;
}

    .apl-insights-pill strong {
        color: #173963;
    }

.apl-insights-pill--selected {
    background: #eaf2ff;
    border-color: #b4cfff;
}

.apl-table-meta {
    background: linear-gradient(90deg,#f8fbff,#fff);
    padding: 10px 18px;
}

.apl-group-head td {
    padding: 7px 11px !important;
    background: #f5f8fe !important;
    border-bottom: 1px solid #e5ecf6 !important;
}

.apl-group-row {
    border: 1px solid #dae6f5;
    border-left: 4px solid #487adb;
    border-radius: 12px;
    background: linear-gradient(98deg,#fff 0%,#f7faff 100%);
    box-shadow: 0 2px 9px rgba(24,56,108,.035);
    transition: border-color .2s,box-shadow .2s,transform .2s;
}

    .apl-group-row:hover {
        border-color: #a8c4ed;
        border-left-color: #3669d2;
        box-shadow: 0 6px 20px rgba(41,91,159,.075);
    }

.apl-group-toggle {
    min-width: 0;
}

.apl-group-toggle__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

    .apl-group-toggle__body strong {
        font-size: 12px;
        line-height: 1.45;
        letter-spacing: -.016em;
        color: #203c66;
        white-space: normal;
        text-align: left;
    }

.apl-group-toggle__eyebrow {
    font-size: 8px;
    letter-spacing: .12em;
    font-weight: 900;
    color: #6690c7;
}

.apl-group-count {
    background: #eaf2ff;
    color: #2e60b5;
    font-weight: 800;
}

.apl-group-picked {
    background: #e4f8ef;
    color: #098463;
}

.apl-table {
    background: #fff;
}

    .apl-table th {
        background: #edf3fb !important;
        color: #596d88;
        letter-spacing: .07em;
    }

    .apl-table tbody tr:not(.apl-group-head) td {
        transition: background .15s;
    }

    .apl-table tbody tr:not(.apl-group-head):hover td {
        background: #eef6ff !important;
    }

.apl-thumb {
    border-radius: 13px;
    background: linear-gradient(135deg,#fff,#f6f9ff);
}

.apl-product__code {
    color: #183f7e;
    letter-spacing: .006em;
}

.apl-product__name {
    color: #536a89;
}

.apl-btn--primary {
    background: linear-gradient(125deg,#3e73e3,#2556ba);
    box-shadow: 0 5px 14px rgba(40,90,190,.16);
}

.apl-selection-action {
    background: linear-gradient(105deg,#eff6ff 0%,#e9f0ff 65%,#f7fbff 100%);
    border-top: 1px solid #d7e7ff;
    border-bottom: 1px solid #c9defe;
    box-shadow: inset 4px 0 #3274e9;
}

.apl-selection-action__cta {
    background: linear-gradient(110deg,#1c57c8,#4b73df);
}

.apl-modal-overlay {
    backdrop-filter: blur(9px) saturate(115%);
    background: rgba(8,21,45,.66);
}

.apl-modal, .apl-modal--hierarchy, .apl-modal--bulk {
    border: 1px solid rgba(222,233,249,.9);
    box-shadow: 0 32px 88px rgba(5,19,48,.29),0 0 0 1px rgba(255,255,255,.22);
}

.apl-hierarchy-modal__hero, .apl-bulk-modal__hero {
    position: relative;
    background: linear-gradient(115deg,#0c1d3d,#1b4480 72%,#3575b7);
}

    .apl-hierarchy-modal__hero::before, .apl-bulk-modal__hero::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: repeating-radial-gradient(circle at 89% -45%,transparent 0 26px,rgba(194,224,255,.08) 27px 28px,transparent 29px 54px);
    }

.apl-modal__header {
    background: linear-gradient(115deg,#f7faff,#fff);
}

.apl-modal__footer {
    box-shadow: 0 -8px 24px rgba(19,44,77,.035);
}

.apl-hierarchy-modal__all, .apl-hierarchy-modal__result, .apl-modal--hierarchy .apl-tree-row {
    border-color: #e0e9f5;
    box-shadow: 0 2px 7px rgba(19,44,77,.028);
}

    .apl-modal--hierarchy .apl-tree-row:hover {
        transform: translateX(2px);
        border-color: #91b9f5;
    }

.apl-bulk-modal__group-head {
    background: #edf4ff;
}

.apl-bulk-modal__products {
    scrollbar-color: #6f9fe5 #edf3fb;
}

.apl-page :is(button,input,select,textarea,a):focus-visible {
    outline: 3px solid #82b5fc;
    outline-offset: 2px;
}

@media (max-width:850px) {
    .apl-hero {
        padding: 21px;
        min-height: unset;
    }

        .apl-hero::before {
            right: -220px;
        }

    .apl-group-toggle__body strong {
        font-size: 11px;
    }
}

@media (max-width:550px) {
    .apl-hero {
        padding: 17px;
        border-radius: 18px;
    }

    .apl-hero__glyph {
        width: 47px;
        height: 47px;
        border-radius: 15px;
    }

    .apl-hero h1 {
        font-size: 23px;
    }

    .apl-catalog__header {
        padding: 14px;
    }

    .apl-category-bar {
        padding: 11px;
    }

    .apl-search-row--unified {
        padding: 12px;
    }

    .apl-hero::before {
        opacity: .36;
    }
}

@media (prefers-reduced-motion:reduce) {
    .apl-page *, .apl-page *::before, .apl-page *::after {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
