﻿.br-root {
    --navy: #0A1B4B;
    --red: #D40000;
    --bg: #f4f6fb;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    font-family: 'Segoe UI',system-ui,-apple-system,sans-serif;
    color: var(--text);
}

    .br-root *, .br-root *::before, .br-root *::after {
        box-sizing: border-box;
    }

    .br-root button, .br-root input {
        font-family: inherit;
    }

    .br-root h1, .br-root h2, .br-root p {
        font-family: inherit;
    }

    .br-root .br-page {
        min-height: 100vh;
        background: linear-gradient(180deg,#fff 0,var(--bg) 220px);
        display: flex;
        flex-direction: column;
    }

    /* Logo */
    .br-root .br-header {
        background: #fff;
        border-bottom: 4px solid var(--red);
        box-shadow: 0 2px 12px rgba(10,27,75,.08);
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 14px 20px;
    }

    .br-root .br-logo {
        height: 54px;
        width: auto;
        max-width: 70%;
        object-fit: contain;
        display: block;
    }

    .br-root .br-logo-fallback {
        font-size: 2.2rem;
        font-weight: 800;
        letter-spacing: -1px;
    }

    .br-root .c-ca, .br-root .c-pe {
        color: var(--navy);
    }

    .br-root .c-amp {
        color: var(--red);
        margin: 0 2px;
    }

    /* Main */
    .br-root .br-main {
        flex: 1;
        width: 100%;
        max-width: 900px;
        margin: 0 auto;
        padding: 28px 16px 40px;
    }

    .br-root .br-title-wrap {
        text-align: center;
        margin-bottom: 22px;
    }

        .br-root .br-title-wrap h1 {
            margin: 0;
            font-size: 1.8rem;
            color: var(--navy);
            font-weight: 800;
        }

        .br-root .br-title-wrap p {
            margin: 6px 0 0;
            color: var(--muted);
            font-size: .95rem;
        }

    /* Tarjeta de búsqueda */
    .br-root .br-search-card {
        background: #fff;
        border-radius: 18px;
        padding: 22px;
        box-shadow: 0 10px 30px rgba(10,27,75,.10);
        border-top: 4px solid var(--navy);
    }

    .br-root .br-label {
        font-size: .78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--muted);
        margin-bottom: 10px;
    }

    .br-root .br-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 18px;
    }

    .br-root .br-chip {
        border: 1.5px solid var(--border);
        background: #fff;
        color: var(--navy);
        padding: 8px 14px;
        border-radius: 999px;
        font-size: .85rem;
        font-weight: 600;
        cursor: pointer;
        transition: all .15s;
    }

        .br-root .br-chip:hover {
            border-color: var(--navy);
        }

        .br-root .br-chip.active {
            background: var(--navy);
            color: #fff;
            border-color: var(--navy);
            box-shadow: 0 4px 12px rgba(10,27,75,.25);
        }

    .br-root .br-input-row {
        display: flex;
        gap: 10px;
    }

    .br-root .br-input-wrap {
        position: relative;
        flex: 1;
        display: flex;
        align-items: center;
    }

        .br-root .br-input-wrap > svg {
            position: absolute;
            left: 14px;
            width: 20px;
            height: 20px;
            color: var(--muted);
        }

    .br-root .br-input {
        width: 100%;
        padding: 14px 40px 14px 44px;
        border: 2px solid var(--border);
        border-radius: 12px;
        font-size: 1rem;
        outline: none;
        background: #fff;
        color: var(--text);
        transition: border-color .15s, box-shadow .15s;
    }

        .br-root .br-input:focus {
            border-color: var(--navy);
            box-shadow: 0 0 0 4px rgba(10,27,75,.10);
        }

    .br-root .br-clear {
        position: absolute;
        right: 10px;
        border: none;
        background: #eef1f7;
        color: var(--muted);
        width: 26px;
        height: 26px;
        border-radius: 50%;
        cursor: pointer;
        font-size: .75rem;
    }

    .br-root .br-btn-buscar {
        background: var(--red);
        color: #fff;
        border: none;
        padding: 0 28px;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        transition: transform .1s, background .15s;
        box-shadow: 0 6px 16px rgba(212,0,0,.3);
    }

        .br-root .br-btn-buscar:hover:not(:disabled) {
            background: #b30000;
        }

        .br-root .br-btn-buscar:active:not(:disabled) {
            transform: scale(.97);
        }

        .br-root .br-btn-buscar:disabled {
            opacity: .5;
            cursor: not-allowed;
            box-shadow: none;
        }

    /* Loader */
    .br-root .br-loader {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 44px 0;
    }

        .br-root .br-loader.small {
            padding: 30px 0;
        }

    .br-root .br-loader-anim {
        position: relative;
        width: 96px;
        height: 96px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .br-root .br-ring {
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 5px solid #dfe5f3;
        border-top-color: var(--red);
        border-right-color: var(--navy);
        animation: br-spin 1s linear infinite;
    }

    .br-root .br-box {
        width: 40px;
        height: 40px;
        color: var(--navy);
        animation: br-bounce 1s ease-in-out infinite;
    }

    .br-root .br-loader-text {
        margin: 18px 0 0;
        font-weight: 700;
        color: var(--navy);
        font-size: 1.05rem;
    }

    .br-root .dots i {
        font-style: normal;
        animation: br-blink 1.2s infinite;
    }

        .br-root .dots i:nth-child(2) {
            animation-delay: .2s;
        }

        .br-root .dots i:nth-child(3) {
            animation-delay: .4s;
        }

@keyframes br-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes br-bounce {
    0%,100% {
        transform: translateY(3px) scale(.95);
    }

    50% {
        transform: translateY(-4px) scale(1.05);
    }
}

@keyframes br-blink {
    0%,20% {
        opacity: .15;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: .15;
    }
}

@keyframes br-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Estados */
.br-root .br-state {
    margin-top: 22px;
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    background: #fff;
}

.br-root .br-error {
    border: 1.5px solid #fecaca;
    background: #fff5f5;
    color: #b91c1c;
}

    .br-root .br-error p {
        margin: 0;
    }

.br-root .br-empty .t {
    margin: 0;
    font-weight: 800;
    color: var(--navy);
    font-size: 1.1rem;
}

.br-root .br-empty .s {
    margin: 4px 0 0;
    color: var(--muted);
}

.br-root .br-welcome {
    text-align: center;
    padding: 40px 0;
}

    .br-root .br-welcome svg {
        width: 90px;
        height: 90px;
    }

    .br-root .br-welcome .t {
        margin: 10px 0 0;
        font-weight: 800;
        color: var(--navy);
        font-size: 1.15rem;
    }

    .br-root .br-welcome .s {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: .92rem;
    }

/* Resultados */
.br-root .br-results {
    margin-top: 24px;
}

.br-root .br-results-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: .9rem;
    color: var(--muted);
    margin-bottom: 14px;
}

.br-root .br-count {
    background: var(--navy);
    color: #fff;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 12px;
}

.br-root .br-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(10,27,75,.07);
    border-left: 5px solid var(--navy);
    animation: br-in .35s ease both;
}

.br-root .br-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.br-root .br-cargo {
    background: #eef1f7;
    color: var(--navy);
    font-family: Consolas,monospace;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: .9rem;
}

.br-root .br-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

    .br-root .br-card-grid .full {
        grid-column: 1 / -1;
    }

    .br-root .br-card-grid label, .br-root .f label {
        display: block;
        font-size: .7rem;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--muted);
        font-weight: 700;
        margin-bottom: 2px;
    }

    .br-root .br-card-grid span, .br-root .f span {
        font-size: .92rem;
        word-break: break-word;
    }

.br-root .br-btn-ver {
    margin-top: 14px;
    width: 100%;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

    .br-root .br-btn-ver:hover {
        background: var(--red);
    }

.br-root .br-estado {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

.br-root .estado-ok {
    background: #dcfce7;
    color: #166534;
}

.br-root .estado-transit {
    background: #dbeafe;
    color: #1e40af;
}

.br-root .estado-pending {
    background: #fef3c7;
    color: #92400e;
}

.br-root .estado-returned {
    background: #fee2e2;
    color: #991b1b;
}

.br-root .estado-default {
    background: #e2e8f0;
    color: #334155;
}

/* Paginado */
.br-root .br-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.br-root .br-pg {
    min-width: 38px;
    height: 38px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--navy);
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

    .br-root .br-pg.active {
        background: var(--navy);
        color: #fff;
        border-color: var(--navy);
    }

    .br-root .br-pg:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

.br-root .br-ell {
    color: var(--muted);
}

.br-root .br-footer {
    text-align: center;
    padding: 16px;
    font-size: .8rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: #fff;
}

/* Modal */
.br-root .br-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,27,75,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 14px;
    backdrop-filter: blur(3px);
}

.br-root .br-modal {
    background: #fff;
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: br-in .25s ease both;
}

.br-root .br-modal-head {
    background: var(--navy);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--red);
}

    .br-root .br-modal-head h2 {
        margin: 0;
        font-size: 1.1rem;
    }

    .br-root .br-modal-head p {
        margin: 2px 0 0;
        font-family: Consolas,monospace;
        font-size: .85rem;
        opacity: .85;
    }

.br-root .br-modal-close {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .9rem;
}

    .br-root .br-modal-close:hover {
        background: var(--red);
    }

.br-root .br-modal-body {
    padding: 18px 20px 22px;
    overflow-y: auto;
}

.br-root .br-detail-sec {
    margin-bottom: 20px;
}

.br-root .br-sec-title {
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--navy);
    border-bottom: 2px solid var(--navy);
    padding-bottom: 5px;
    margin-bottom: 12px;
}

    .br-root .br-sec-title.red {
        color: var(--red);
        border-color: var(--red);
    }

.br-root .br-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

    .br-root .br-detail-grid .full {
        grid-column: 1 / -1;
    }

.br-root .mono {
    font-family: Consolas,monospace;
    font-weight: 700;
    color: var(--navy);
}

.br-root .br-doc-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    display: block;
}

.br-root .br-hint {
    text-align: center;
    font-size: .78rem;
    color: var(--muted);
    margin-top: 6px;
}

.br-root .br-noimg {
    text-align: center;
    padding: 26px;
    background: #f8fafc;
    border: 2px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
}

    .br-root .br-noimg p {
        margin: 0;
        font-weight: 700;
    }

/* Lightbox */
.br-root .br-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.br-root .br-lightbox-inner {
    position: relative;
    max-width: 96vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .br-root .br-lightbox-inner img {
        max-width: 100%;
        max-height: 84vh;
        border-radius: 10px;
        object-fit: contain;
    }

.br-root .br-modal-close.light {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 2;
    background: var(--red);
}

.br-root .br-lightbox-cap {
    color: #cbd5e1;
    margin-top: 10px;
    font-size: .85rem;
}

@media (max-width:600px) {
    .br-root .br-title-wrap h1 {
        font-size: 1.45rem;
    }

    .br-root .br-input-row {
        flex-direction: column;
    }

    .br-root .br-btn-buscar {
        padding: 14px;
    }

    .br-root .br-search-card {
        padding: 16px;
    }

    .br-root .br-card-grid, .br-root .br-detail-grid {
        grid-template-columns: 1fr;
    }
}
