.painel-shell.rm-board .rm-secao {
    margin-top: 1.1rem;
}

.painel-shell.rm-board .rm-secao-titulo {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: inherit;
}

.painel-shell.rm-board .rm-secao-ajuda {
    margin: 0.15rem 0 0.55rem;
    font-size: 0.82rem;
    opacity: 0.72;
}

.painel-shell.rm-board .painel-legend {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem 0.75rem;
}

.painel-shell.rm-board .painel-legend .agente-refresh {
    margin-left: auto;
}

.painel-shell.rm-board .painel-cols,
.painel-shell.rm-board .painel-head.painel-cols,
.painel-shell.rm-board .painel-row .painel-cols {
    display: grid;
    grid-template-columns: 4.2rem minmax(10rem, 1.1fr) minmax(0, 0.7fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(10rem, 1.1fr) 3.4rem;
    grid-auto-flow: column;
    grid-auto-rows: auto;
    align-items: center;
    column-gap: 0.55rem;
    width: 100%;
    min-width: 0;
}

.painel-shell.rm-board .painel-cols > div,
.painel-shell.rm-board .painel-row .painel-cols > div {
    min-width: 0;
    max-width: 100%;
}

.painel-shell.rm-board .painel-row .col-placa,
.painel-shell.rm-board .painel-row .col-forn,
.painel-shell.rm-board .painel-row .col-nf {
    overflow: hidden;
}

.painel-shell.rm-board .painel-head .col-od,
.painel-shell.rm-board .painel-head .col-status,
.painel-shell.rm-board .painel-head .col-placa,
.painel-shell.rm-board .painel-head .col-nf,
.painel-shell.rm-board .painel-head .col-prox,
.painel-shell.rm-board .painel-head .col-acao {
    display: flex;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.painel-shell.rm-board .painel-row .col-placa,
.painel-shell.rm-board .painel-row .col-nf {
    text-align: center;
}

.painel-shell.rm-board .painel-row .col-placa,
.painel-shell.rm-board .painel-row .col-forn,
.painel-shell.rm-board .painel-row .col-nf {
    white-space: nowrap;
    text-overflow: ellipsis;
}

.painel-shell.rm-board .col-od {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.painel-shell.rm-board .painel-doca-nome {
    min-width: 0;
}

.painel-shell.rm-board .col-status,
.painel-shell.rm-board .col-prox {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

@keyframes rm-status-pisca {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.painel-shell.rm-board .painel-legend .rm-status-pisca,
.painel-shell.rm-board .painel-row.rm-status-pisca .col-status .painel-badge,
.painel-shell.rm-board .painel-row.rm-status-pisca .col-prox .rm-prox-btn,
.painel-shell.rm-board .painel-row.rm-status-pisca .col-prox .rm-status-fill,
.painel-shell.rm-board .painel-row.rm-status-pisca .col-prox .rm-definir-status {
    animation: rm-status-pisca 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .painel-shell.rm-board .painel-legend .rm-status-pisca,
    .painel-shell.rm-board .painel-row.rm-status-pisca .col-status .painel-badge,
    .painel-shell.rm-board .painel-row.rm-status-pisca .col-prox .rm-prox-btn,
    .painel-shell.rm-board .painel-row.rm-status-pisca .col-prox .rm-status-fill,
    .painel-shell.rm-board .painel-row.rm-status-pisca .col-prox .rm-definir-status {
        animation: none;
    }
}

.painel-shell.rm-board .col-status .painel-badge,
.painel-shell.rm-board .rm-prox-btn,
.painel-shell.rm-board .rm-status-fill,
.painel-shell.rm-board .rm-definir-status .rm-definir-btn {
    width: 100%;
    min-height: 38px;
    height: 38px;
    max-width: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    font-size: 0.76rem;
    font-weight: 800;
}

.painel-shell.rm-board .rm-status-fill {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    background: #C2410C;
    border: 0;
}

.painel-shell.rm-board .col-acao {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
    z-index: 2;
}

.painel-shell.rm-board .painel-row .col-acao {
    z-index: 3;
}

.painel-shell.rm-board .painel-row:hover,
.painel-shell.rm-board .painel-row:focus-within,
.painel-shell.rm-board .painel-row:has(.show) {
    z-index: 20;
}

.painel-shell.rm-board .btn-group,
.painel-shell.rm-board .btn-group.show,
.painel-shell.rm-board .btn-group:has(.show) {
    position: relative;
    z-index: 4;
}

.painel-shell.rm-board .rm-btn {
    min-height: 34px;
    font-weight: 700;
    white-space: nowrap;
}

.painel-shell.rm-board .painel-row {
    flex: 0 0 auto;
    overflow: visible;
}

.painel-shell.rm-board .rm-sub {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--pl-muted);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.painel-shell.rm-board .rm-erro {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #FECACA;
    font-weight: 700;
}

.painel-shell.rm-board.painel-theme-light .rm-erro {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

.painel-shell.rm-board .rm-definir-status {
    position: relative;
    width: 100%;
    min-width: 0;
    display: block;
    align-self: stretch;
}

.painel-shell.rm-board .rm-definir-status .rm-definir-btn {
    width: 100%;
    pointer-events: none;
    border: 0;
}

.painel-shell.rm-board .rm-definir-status .rm-status-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    border: 0;
    background: transparent;
    background-image: none;
    color: transparent;
    appearance: none;
    -webkit-appearance: none;
    font-size: 16px; /* iOS não dá zoom no select */
    line-height: 1;
    box-shadow: none;
}

.painel-shell.rm-board .rm-status-select:focus {
    border-color: transparent;
    box-shadow: none;
}

.painel-shell.rm-board .rm-prox-btn {
    appearance: none;
    border: 0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #fff;
    background: #C2410C;
    cursor: pointer;
}

.painel-shell.rm-board .dot-CINZA { background: #64748B; }

.painel-shell.rm-board .rm-prox-btn.prox-ENCERRAR_AUSENTE {
    background: #475569;
}
.painel-shell.rm-board .rm-prox-btn.prox-CADASTRAR_CAC,
.painel-shell.rm-board .rm-prox-btn.prox-DEFINIR_SAIDA {
    background: #15803D;
}

.rm-saida-escolhas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.rm-saida-escolha {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    min-height: 7rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--pl-chip-border);
    border-radius: 14px;
    background: var(--pl-chip-bg);
    text-align: left;
    color: var(--pl-text-strong);
}

.rm-saida-escolha strong {
    font-size: 1rem;
}

.rm-saida-escolha span {
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0.78;
}

.rm-saida-escolha.is-direta:hover {
    border-color: #15803D;
}

.rm-saida-escolha.is-cac:hover {
    border-color: #C2410C;
}

@media (max-width: 640px) {
    .rm-saida-escolhas {
        grid-template-columns: 1fr;
    }
}

.painel-shell.rm-board .rm-prox-btn.prox-AJUSTAR_CAC {
    background: #C2410C;
}

.painel-shell.rm-board .rm-prox-btn.prox-ENVIAR_DOCA {
    background: #FBBF24;
    color: #fff;
}

.rm-page {
    position: relative;
}

.rm-cac-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(5, 24, 53, 0.55);
    z-index: 4000;
}

.rm-cac-modal .modal-dialog {
    margin: 0;
    width: min(40rem, 100%);
}

.rm-cac-modal .modal-dialog.modal-lg {
    width: min(44rem, 100%);
    max-width: 44rem;
}

.rm-cac-modal .modal-content {
    border: 0;
    border-radius: 16px;
    background: var(--pl-surface, #fff);
    color: var(--pl-text, #0F172A);
}

.painel-shell.painel-theme-light .rm-confirm,
.painel-shell.painel-theme-light .rm-cac {
    background: #fff;
    color: #0F172A;
}

.painel-shell.painel-theme-dark .rm-confirm,
.painel-shell.painel-theme-dark .rm-cac {
    background: #13294B;
    color: #F8FAFC;
}

.rm-cac-ajuda {
    margin: 0 0 0.9rem;
    color: var(--pl-muted, #64748b);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
}

.rm-cac-alerta {
    margin: 0 0 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.28);
    color: #B91C1C;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.4;
}

.rm-cac-card {
    margin-bottom: 0.7rem;
    padding: 0.8rem 0.9rem 0.9rem;
    border: 1px solid var(--pl-border, #e2e8f0);
    border-radius: 14px;
    background: var(--pl-chip-bg, rgba(148, 163, 184, 0.08));
}

.rm-cac-card.is-ok {
    border-color: rgba(22, 163, 74, 0.45);
    background: rgba(22, 163, 74, 0.08);
}

.rm-cac-card.is-nao {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.08);
}

.rm-cac-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.rm-cac-card-top span {
    color: var(--pl-muted, #64748b);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rm-cac-remover {
    width: 32px;
    height: 32px;
    border: 1px solid var(--pl-chip-border, #d8e0ea);
    border-radius: 10px;
    background: transparent;
    color: var(--pl-text-strong, #051835);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.rm-cac-remover:hover,
.rm-cac-remover:focus {
    border-color: #dc2626;
    color: #dc2626;
    outline: 0;
}

.rm-cac-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) 5.2rem 5.2rem;
    gap: 0.55rem;
}

.rm-cac-field span {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--pl-muted, #64748b);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rm-cac-field .form-control {
    min-height: 42px;
    border-radius: 10px;
    border-color: var(--pl-chip-border, #d8e0ea);
    background: var(--pl-surface, #fff);
    color: var(--pl-text-strong, #051835);
    font-weight: 700;
}

.rm-cac-field .form-control:focus {
    border-color: #D84D15;
    box-shadow: 0 0 0 0.15rem rgba(216, 77, 21, 0.22);
}

.rm-cac-portaria {
    margin-top: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: rgba(22, 163, 74, 0.1);
    color: #166534;
    font-size: 0.82rem;
    line-height: 1.35;
}

.rm-cac-card.is-nao .rm-cac-portaria {
    background: rgba(220, 38, 38, 0.1);
    color: #B91C1C;
}

.rm-cac-portaria strong {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rm-cac-portaria p {
    margin: 0.2rem 0 0;
    font-weight: 700;
}

.rm-cac-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: 1px dashed var(--pl-chip-border, #d8e0ea);
    background: transparent;
    color: var(--pl-text-strong, #051835);
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.rm-cac-add:hover,
.rm-cac-add:focus {
    border-color: #D84D15;
    color: #D84D15;
    outline: 0;
}

.rm-confirm .gp-hero {
    margin-bottom: 0.85rem;
}

.rm-dactes {
    margin-top: 0.85rem;
}

.rm-dactes > span {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--pl-muted, #64748b);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rm-dactes > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rm-dactes b {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--pl-border, #e2e8f0);
    background: var(--pl-chip-bg, rgba(148, 163, 184, 0.1));
    color: var(--pl-text-strong, #051835);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.rm-troca {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.4rem minmax(0, 1fr);
    align-items: stretch;
    gap: 0.7rem;
    margin-top: 1.1rem;
}

.rm-troca-de,
.rm-troca-para {
    min-width: 0;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid var(--pl-border, #e2e8f0);
    background: var(--pl-chip-bg, rgba(148, 163, 184, 0.08));
}

.rm-troca-de span,
.rm-troca-para span {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pl-muted, #64748b);
}

.rm-troca-de b,
.rm-troca-para b {
    display: block;
    color: var(--pl-text-strong, #051835);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.25;
}

.rm-troca-para {
    border-color: rgba(216, 77, 21, 0.45);
    background: rgba(216, 77, 21, 0.1);
}

.rm-troca-para span,
.rm-troca-para b {
    color: #D84D15;
}

.rm-troca-relato {
    margin-top: 14px;
}

.rm-troca-relato label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.rm-troca-relato textarea {
    width: 100%;
    border: 1px solid rgba(153, 27, 27, 0.35);
    border-radius: 10px;
    padding: 8px 10px;
    resize: vertical;
}

.rm-troca-seta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    margin: auto 0;
    border-radius: 999px;
    background: #D84D15;
    color: #fff;
    font-size: 0.85rem;
}

.rm-confirm-btn {
    background: #D84D15;
    border-color: #D84D15;
    font-weight: 800;
    border-radius: 10px;
    padding: 0.5rem 1.2rem;
}

.rm-confirm-btn:hover,
.rm-confirm-btn:focus {
    background: #c04412;
    border-color: #c04412;
}


@media (max-width: 1199.98px) {
    .painel-shell.rm-board .painel-head,
    .painel-shell.rm-board .painel-head.painel-cols {
        display: none;
    }

    .painel-shell.rm-board .painel-legend .agente-refresh {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }

    .painel-shell.rm-board .painel-row .painel-cols {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.2rem;
        grid-auto-flow: row;
        gap: 0.42rem 0.55rem;
        padding: 0.8rem 0.85rem 0.8rem 1.05rem;
        align-items: start;
    }

    .painel-shell.rm-board .painel-row .painel-cols > div:not(.col-acao) {
        overflow: hidden;
        white-space: normal;
        text-overflow: unset;
    }

    .painel-shell.rm-board .painel-row .col-od {
        grid-column: 1 / 3;
        grid-row: 1;
        justify-content: flex-start;
    }

    .painel-shell.rm-board .painel-row .col-acao {
        grid-column: 3;
        grid-row: 1;
        justify-content: flex-end;
        align-items: flex-start;
        overflow: visible;
    }

    .painel-shell.rm-board .painel-row .col-placa,
    .painel-shell.rm-board .painel-row .col-forn,
    .painel-shell.rm-board .painel-row .col-nf,
    .painel-shell.rm-board .painel-row .col-status,
    .painel-shell.rm-board .painel-row .col-prox {
        text-align: left;
        white-space: normal;
    }

    .painel-shell.rm-board .painel-row .col-placa {
        grid-column: 1;
        grid-row: 2;
        font-size: 1.05rem;
    }

    .painel-shell.rm-board .painel-row .col-forn {
        grid-column: 2 / -1;
        grid-row: 2;
    }

    .painel-shell.rm-board .painel-row .col-nf {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .painel-shell.rm-board .painel-row .col-status {
        grid-column: 1;
        grid-row: 4;
        align-items: stretch;
    }

    .painel-shell.rm-board .painel-row .col-prox {
        grid-column: 2 / -1;
        grid-row: 4;
        align-items: stretch;
    }

    .painel-shell.rm-board .painel-row .col-status .painel-badge,
    .painel-shell.rm-board .painel-row .col-prox .rm-prox-btn,
    .painel-shell.rm-board .painel-row .col-prox .rm-status-fill,
    .painel-shell.rm-board .painel-row .col-prox .rm-definir-status .rm-definir-btn {
        width: 100%;
        max-width: none;
        height: 2.05rem;
        min-height: 2.05rem;
        padding: 0.28rem 0.55rem;
        border-radius: 999px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        justify-content: center;
        text-align: center;
        line-height: 1.15;
        font-size: 0.72rem;
        font-weight: 800;
    }

    .painel-shell.rm-board .painel-row .col-prox .rm-definir-status {
        width: 100%;
        height: 2.05rem;
        min-height: 2.05rem;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow: visible;
        box-shadow: none;
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
        white-space: normal;
        display: block;
    }

    .painel-shell.rm-board .painel-row [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.12rem;
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--pl-muted);
        line-height: 1.1;
    }

    .painel-shell.rm-board .painel-row .col-status[data-label]::before,
    .painel-shell.rm-board .painel-row .col-prox[data-label]::before {
        display: none;
    }

    .rm-cac-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 599.98px) {
    .painel-shell.rm-board .painel-row .painel-cols {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.2rem;
    }

    .painel-shell.rm-board .painel-row .col-od { grid-row: 1; grid-column: 1 / 3; }
    .painel-shell.rm-board .painel-row .col-acao { grid-row: 1; grid-column: 3; }
    .painel-shell.rm-board .painel-row .col-placa { grid-row: 2; grid-column: 1 / -1; }
    .painel-shell.rm-board .painel-row .col-forn { grid-row: 3; grid-column: 1 / -1; }
    .painel-shell.rm-board .painel-row .col-nf { grid-row: 4; grid-column: 1 / -1; }
    .painel-shell.rm-board .painel-row .col-status { grid-row: 5; grid-column: 1; }
    .painel-shell.rm-board .painel-row .col-prox { grid-row: 5; grid-column: 2; }

    .rm-troca {
        grid-template-columns: 1fr;
    }

    .rm-troca-seta {
        transform: rotate(90deg);
    }
}

body.pl-embed .painel-shell.rm-board {
    height: 100vh;
    height: 100dvh;
}

body.pl-embed .painel-shell.rm-board .painel-board {
    overflow: auto;
}
