/* Painel logístico — dark / light, layout das referências */

html.pl-board-boot,
html.pl-board-boot body {
    background-image: none !important;
    background-color: #061428 !important;
}

html.pl-board-boot.pl-board-light,
html.pl-board-boot.pl-board-light body {
    background-color: #F3F6FB !important;
}

body.painel-board-active {
    --pl-bg: #061428;
    --pl-bg-2: #07182F;
    --pl-surface: #0B1F3C;
    --pl-surface-2: #0A1C37;
    --pl-row: #0A1E38;
    --pl-text: #F8FAFC;
    --pl-text-strong: #FFFFFF;
    --pl-muted: #93A4BB;
    --pl-muted-2: #7B8FA8;
    --pl-border: rgba(148, 163, 184, 0.22);
    --pl-chip-bg: #0C2344;
    --pl-chip-border: rgba(148, 163, 184, 0.28);
    --pl-icon-btn: #0C2344;
    --pl-icon-btn-border: rgba(148, 163, 184, 0.32);
    --pl-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    --bs-modal-bg: var(--pl-surface);
    --bs-modal-color: var(--pl-text);
    --bs-modal-border-color: var(--pl-border);
    --bs-modal-header-border-color: var(--pl-border);
    --bs-modal-footer-border-color: var(--pl-border);
    --bs-body-bg: var(--pl-surface);
    --bs-body-color: var(--pl-text);
    background-image: none !important;
    background-color: #061428 !important;
}

body.painel-board-active.painel-theme-light {
    --pl-bg: #F3F6FB;
    --pl-bg-2: #F3F6FB;
    --pl-surface: #FFFFFF;
    --pl-surface-2: #FFFFFF;
    --pl-row: #FFFFFF;
    --pl-text: #0B1F3A;
    --pl-text-strong: #071428;
    --pl-muted: #64748B;
    --pl-muted-2: #7B8FA8;
    --pl-border: #E2E8F0;
    --pl-chip-bg: #FFFFFF;
    --pl-chip-border: #D8E0EA;
    --pl-icon-btn: #FFFFFF;
    --pl-icon-btn-border: #D8E0EA;
    --pl-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    background-color: #F3F6FB !important;
}

body.painel-board-active .sa-drawer,
body.painel-board-active .sa-drawer-backdrop {
    top: var(--pl-topnav-h, 64px);
}

.painel-shell {
    --pl-bg: #061428;
    --pl-bg-2: #07182F;
    --pl-surface: #0B1F3C;
    --pl-surface-2: #0A1C37;
    --pl-row: #0A1E38;
    --pl-text: #F8FAFC;
    --pl-text-strong: #FFFFFF;
    --pl-muted: #93A4BB;
    --pl-muted-2: #7B8FA8;
    --pl-border: rgba(148, 163, 184, 0.16);
    --pl-chip-bg: #0C2344;
    --pl-chip-border: rgba(148, 163, 184, 0.28);
    --pl-icon-btn: #0C2344;
    --pl-icon-btn-border: rgba(148, 163, 184, 0.32);
    --pl-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    --pl-critica: rgba(185, 28, 28, 0.38);
    --pl-critica-text: #FEE2E2;
    --pl-green: #22C55E;
    --pl-yellow: #EAB308;
    --pl-blue: #3B82F6;
    --pl-gray: #94A3B8;
    --pl-orange: #F59E0B;
    --pl-red: #EF4444;
    --pl-badge-livre-bg: #16A34A;
    --pl-badge-livre-fg: #fff;
    --pl-badge-transito-bg: #EAB308;
    --pl-badge-transito-fg: #fff;
    --pl-head-fg: #9FB0C7;
    color: var(--pl-text);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.painel-shell.painel-theme-light,
body.painel-board-active.painel-theme-light {
    color-scheme: light;
}

.painel-shell.painel-theme-light {
    --pl-bg: #F3F6FB;
    --pl-bg-2: #F3F6FB;
    --pl-surface: #FFFFFF;
    --pl-surface-2: #FFFFFF;
    --pl-row: #FFFFFF;
    --pl-text: #0B1F3A;
    --pl-text-strong: #071428;
    --pl-muted: #64748B;
    --pl-muted-2: #7B8FA8;
    --pl-border: #E2E8F0;
    --pl-chip-bg: #FFFFFF;
    --pl-chip-border: #D8E0EA;
    --pl-icon-btn: #FFFFFF;
    --pl-icon-btn-border: #D8E0EA;
    --pl-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --pl-critica: #FDE8E8;
    --pl-critica-text: #9F1239;
    --pl-badge-livre-bg: #16A34A;
    --pl-badge-livre-fg: #fff;
    --pl-badge-transito-bg: #CA8A04;
    --pl-badge-transito-fg: #fff;
    --pl-head-fg: #64748B;
}

.painel-shell {
    width: 100%;
    height: calc(100vh - var(--pl-topnav-h, 64px));
    height: calc(100dvh - var(--pl-topnav-h, 64px));
    overflow: hidden;
    background: var(--pl-bg);
}

.painel-shell .painel-board {
    width: 100%;
    height: 100%;
    background: var(--pl-bg);
    color: var(--pl-text);
    padding: 8px 22px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    overflow: hidden;
    flex: 0 0 auto;
}

.painel-shell .painel-toolbar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 0 auto;
}

.painel-shell .painel-busca {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    padding: 0 0.95rem;
    border-radius: 999px;
    background: var(--pl-chip-bg);
    border: 1px solid var(--pl-chip-border);
    color: var(--pl-muted);
    box-shadow: var(--pl-shadow);
}

.painel-shell .painel-busca input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--pl-text-strong);
    font-size: 0.92rem;
    font-weight: 650;
    outline: none;
}

.painel-shell .painel-busca input::placeholder {
    color: var(--pl-muted);
    font-weight: 600;
}

/* Header */
.painel-shell .painel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    min-height: 64px;
}

.painel-shell .painel-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.painel-shell .painel-brand-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 auto;
}

.painel-shell.painel-theme-light .painel-brand-icon {
    background: #071428;
    border-radius: 12px;
    padding: 6px;
    filter: none;
    box-sizing: border-box;
}

.painel-shell .painel-brand-name {
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    color: var(--pl-text-strong);
}

.painel-shell .painel-brand-grupo {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--pl-muted);
}

.painel-shell .painel-brand-name strong {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.painel-shell .painel-title {
    margin-left: 0.55rem;
    padding-left: 0.85rem;
    border-left: 1px solid var(--pl-border);
    min-width: 0;
}

.painel-shell .painel-title h1 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--pl-text-strong);
    white-space: nowrap;
}

.painel-shell .painel-title p {
    margin: 0.12rem 0 0;
    font-size: 0.78rem;
    color: var(--pl-muted);
    white-space: nowrap;
}

.painel-shell .painel-top-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.painel-shell .painel-select-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0 0.9rem;
    border-radius: 999px;
    background: var(--pl-chip-bg);
    border: 1px solid var(--pl-chip-border);
    color: var(--pl-text);
    box-shadow: var(--pl-shadow);
    flex: 0 0 auto;
    max-width: 240px;
}

.painel-shell .painel-select-chip > .fa-truck,
.painel-shell .painel-select-chip > .fa-boxes-stacked {
    color: var(--pl-muted);
    font-size: 0.82rem;
}

.painel-shell .painel-select,
.painel-shell .painel-select-label {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    outline: none;
    min-width: 8.5rem;
    max-width: 12rem;
    padding: 0 1.05rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.painel-shell .painel-select {
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.painel-shell .painel-select option {
    background: #0B1F3C;
    color: #F8FAFC;
}

.painel-shell.painel-theme-light .painel-select option {
    background: #fff;
    color: #0B1F3A;
}

.painel-shell .painel-select-caret {
    position: absolute;
    right: 0.7rem;
    font-size: 0.62rem;
    color: var(--pl-muted);
    pointer-events: none;
}

.painel-shell .painel-clock {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--pl-text-strong);
    padding: 0 0.35rem;
    font-variant-numeric: tabular-nums;
}

.painel-shell .painel-clock > i {
    font-size: 1.05rem;
    color: var(--pl-muted);
}

.painel-shell .painel-clock-texts {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.painel-shell .painel-clock-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--pl-muted);
}

.painel-shell .painel-clock-line {
    display: flex;
    align-items: baseline;
    gap: 0.28rem;
}

.painel-shell .painel-clock-line strong {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.painel-shell .painel-clock-refresh {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--pl-muted);
}

.painel-shell .painel-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--pl-icon-btn-border);
    background: var(--pl-icon-btn);
    color: var(--pl-text-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--pl-shadow);
    cursor: pointer;
    flex: 0 0 auto;
}

.painel-shell .painel-icon-btn:hover {
    border-color: #D84D15;
}

.painel-shell .painel-icon-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.18rem rgba(216, 77, 21, 0.28);
}

.painel-shell.painel-theme-dark .fa-moon,
.painel-shell.painel-theme-light .fa-sun {
    display: none !important;
}

.painel-shell .painel-burger {
    width: 16px;
    height: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.painel-shell .painel-burger i {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 99px;
    background: currentColor;
}

.painel-shell .painel-menu-wrap {
    position: relative;
}

.painel-shell .painel-menu-drop {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 180px;
    background: var(--pl-surface);
    border: 1px solid var(--pl-border);
    border-radius: 12px;
    box-shadow: var(--pl-shadow);
    padding: 0.35rem;
    z-index: 30;
    display: flex;
    flex-direction: column;
}

.painel-shell .painel-menu-drop button {
    border: 0;
    background: transparent;
    color: var(--pl-text);
    text-align: left;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
}

.painel-shell .painel-menu-drop button:hover,
.painel-shell .painel-menu-drop button.is-exit {
    background: rgba(216, 77, 21, 0.12);
}

/* Legenda */
.painel-shell .painel-legend {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 1.1rem;
    padding: 0 0.15rem;
    color: var(--pl-text);
    font-size: 0.86rem;
    font-weight: 700;
    flex: 0 0 auto;
}

sis-legenda-status {
    display: contents;
}

.painel-shell .painel-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.painel-shell .painel-legend i {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
}

.painel-shell .painel-footer i.dot-VERDE,
.painel-shell .painel-footer i.dot-VERDE_SAIDA,
.painel-shell .painel-footer i.dot-AMARELO,
.painel-shell .painel-footer i.dot-AZUL,
.painel-shell .painel-footer i.dot-BRANCO,
.painel-shell .painel-footer i.dot-LARANJA,
.painel-shell .painel-footer i.dot-ROXO,
.painel-shell .painel-footer i.dot-SLATE,
.painel-shell .painel-footer i.dot-TEAL,
.painel-shell .painel-footer i.dot-COBRANCA,
.painel-shell .painel-footer i.dot-VERMELHO {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
}

.painel-shell .dot-VERDE { background: #22C55E; }
.painel-shell .dot-VERDE_SAIDA { background: #15803D; }
.painel-shell .dot-BRANCO { background: #94A3B8; }
.painel-shell .dot-AMARELO { background: #EAB308; }
.painel-shell .dot-AZUL { background: #3B82F6; }
.painel-shell .dot-LARANJA { background: #F59E0B; }
.painel-shell .dot-ROXO { background: #7C3AED; }
.painel-shell .dot-SLATE { background: #64748B; }
.painel-shell .dot-TEAL { background: #0D9488; }
.painel-shell .dot-COBRANCA { background: #16A34A; }
.painel-shell .dot-VERMELHO { background: #EF4444; }

/* Tabela / cards */
.painel-shell .painel-table {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.painel-shell .painel-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.55fr) minmax(0, 0.75fr) minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.05fr);
    align-items: center;
    column-gap: 0.45rem;
    width: 100%;
    min-width: 0;
}

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

/* Dado de uma coluna não pode pintar em cima da vizinha ao encolher a tela */
.painel-shell .painel-row .painel-cols > div:not(.col-acao) {
    overflow: hidden;
}

.painel-shell .col-acao {
    overflow: visible !important;
}

.painel-shell .painel-row:has(.show),
.painel-shell .painel-row:has(.agente-acao-btn[aria-expanded="true"]) {
    overflow: visible;
    z-index: 40;
}

.painel-shell .painel-head {
    background: var(--pl-surface);
    border: 1px solid var(--pl-border);
    border-radius: 14px;
    min-height: 48px;
    padding: 0.45rem 0.9rem 0.45rem 1.15rem;
    color: var(--pl-head-fg);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: var(--pl-shadow);
    flex: 0 0 auto;
    overflow: hidden;
}

.painel-shell .painel-head .col-doca,
.painel-shell .painel-head .col-id,
.painel-shell .painel-head .col-placa,
.painel-shell .painel-head .col-forn {
    white-space: nowrap;
}

.painel-shell .painel-head > div {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    line-height: 1.15;
}

.painel-shell .painel-head > [data-sort] {
    cursor: pointer;
    user-select: none;
}

.painel-shell .painel-head > [data-sort]:hover,
.painel-shell .painel-head > [data-sort].is-sort {
    color: #D84D15;
}

.painel-shell .painel-head > [data-sort]:hover span,
.painel-shell .painel-head > [data-sort].is-sort span,
.painel-shell .painel-head > [data-sort]:hover i,
.painel-shell .painel-head > [data-sort].is-sort i {
    color: inherit;
}

.painel-shell .painel-head > [data-sort]::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.2rem;
    border-left: 0.28em solid transparent;
    border-right: 0.28em solid transparent;
    border-bottom: 0.36em solid currentColor;
    opacity: 0.28;
    transform: translateY(-1px);
}

.painel-shell .painel-head > [data-sort].is-sort::after {
    opacity: 1;
}

.painel-shell .painel-head > [data-sort].is-desc::after {
    border-bottom: 0;
    border-top: 0.36em solid currentColor;
    transform: translateY(1px);
}

.painel-shell .painel-head,
.painel-shell .painel-head > div,
.painel-shell .painel-head span {
    color: var(--pl-head-fg);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.painel-shell .painel-head svg {
    width: 0.95em;
    height: 0.95em;
    color: var(--pl-head-fg);
    fill: currentColor;
}

.painel-shell .painel-head .col-doca,
.painel-shell .painel-head .col-forn {
    justify-content: flex-start;
}

.painel-shell .painel-head .col-id,
.painel-shell .painel-head .col-placa,
.painel-shell .painel-head .col-tempo,
.painel-shell .painel-head .col-duracao {
    display: flex;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.painel-shell .painel-head .col-id span,
.painel-shell .painel-head .col-placa span,
.painel-shell .painel-head .col-tempo span,
.painel-shell .painel-head .col-duracao span {
    min-width: 0;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.painel-shell .painel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    padding-right: 2px;
}

.painel-shell .painel-row {
    position: relative;
    background: var(--pl-row);
    border: 1px solid var(--pl-border);
    border-radius: 14px;
    min-height: 54px;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: var(--pl-shadow);
}

.painel-shell .painel-row-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 7px;
    background: #64748B;
}

.painel-shell .painel-row.st-VERDE .painel-row-bar { background: #22C55E; }
.painel-shell .painel-row.st-AMARELO .painel-row-bar { background: #EAB308; }
.painel-shell .painel-row.st-VERMELHO .painel-row-bar { background: #EF4444; }
.painel-shell .painel-row.st-AZUL .painel-row-bar { background: #3B82F6; }
.painel-shell .painel-row.st-BRANCO .painel-row-bar { background: #94A3B8; }
.painel-shell .painel-row.st-LARANJA .painel-row-bar { background: #F59E0B; }
.painel-shell .painel-row.st-ROXO .painel-row-bar { background: #7C3AED; }
.painel-shell .painel-row.st-PRETO .painel-row-bar { background: #0F172A; }

.painel-shell .painel-row .painel-cols {
    padding: 0.35rem 0.9rem 0.35rem 1.15rem;
}

.painel-shell .painel-row.is-critica {
    background: var(--pl-critica);
    border-color: rgba(239, 68, 68, 0.35);
}

.painel-shell .painel-row.is-critica,
.painel-shell .painel-row.is-critica .painel-doca-nome,
.painel-shell .painel-row.is-critica .col-id,
.painel-shell .painel-row.is-critica .col-placa,
.painel-shell .painel-row.is-critica .col-forn,
.painel-shell .painel-row.is-critica .col-duracao {
    color: var(--pl-critica-text);
}

.painel-shell .col-doca {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    min-width: 0;
}

.painel-shell .painel-doca-nome {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--pl-text-strong);
    white-space: nowrap;
    min-width: 0;
    flex: 0 1 auto;
}

.painel-shell .painel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    min-height: 1.7rem;
    max-width: 100%;
    min-width: 0;
    padding: 0.18rem 0.72rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    background: #475569;
    color: #fff;
}

.painel-shell .painel-badge,
.painel-shell .painel-badge[class*="badge-"] {
    color: #fff;
}

.painel-shell .badge-VERDE {
    background: var(--pl-badge-livre-bg);
    color: #fff;
}
.painel-shell .badge-AMARELO {
    background: var(--pl-badge-transito-bg);
    color: #fff;
}
.painel-shell .badge-AZUL,
.painel-shell .badge-AZUL_CLARO { background: #3B82F6; color: #fff; }
.painel-shell .badge-BRANCO { background: #64748B; color: #fff; }
.painel-shell .badge-LARANJA { background: #F59E0B; color: #fff; }
.painel-shell .badge-ROXO { background: #7C3AED; color: #fff; }
.painel-shell .badge-VERMELHO,
.painel-shell .badge-PISCA_VERMELHO { background: #EF4444; color: #fff; }
.painel-shell .badge-PRETO { background: #0F172A; color: #fff; }
.painel-shell .badge-VERDE_CLARO,
.painel-shell .badge-VERDE_ESCURO { background: #166534; color: #fff; }

.painel-shell .painel-row .col-id,
.painel-shell .painel-row .col-placa,
.painel-shell .painel-row .col-tempo,
.painel-shell .painel-row .col-duracao {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--pl-text-strong);
    text-align: center;
}

.painel-shell .painel-row .col-placa,
.painel-shell .painel-row .col-id,
.painel-shell .painel-row .col-ped,
.painel-shell .painel-row .col-agend,
.painel-shell .painel-row .col-tipo,
.painel-shell .painel-row .col-nf {
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.painel-shell .painel-row .col-forn {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--pl-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.painel-shell .painel-row .painel-cols > div :is(.painel-badge, .ops-patio-chip, .ops-doca-chip, .portaria-prox-btn, .ind-chip, .ind-wrap) {
    max-width: 100%;
}

#container_events_painel.painel-docas .painel-cols,
#container_events_painel.painel-docas .painel-head.painel-cols,
#container_events_painel.painel-docas .painel-row .painel-cols {
    grid-template-columns: 5.6rem minmax(10rem, 1.15fr) minmax(0, 0.55fr) minmax(0, 0.75fr) minmax(0, 1.5fr) minmax(0, 0.9fr) minmax(0, 0.85fr) minmax(0, 0.85fr) minmax(0, 0.95fr);
}

#container_events_painel.painel-docas .col-doca {
    flex-wrap: nowrap;
    justify-content: center;
}

#container_events_painel.painel-docas .painel-head .col-status {
    display: flex;
    width: 100%;
    justify-content: center;
    text-align: center;
}

#container_events_painel.painel-docas .col-status {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

#container_events_painel.painel-docas .col-status .painel-badge {
    width: 100%;
    min-height: 38px;
    height: 38px;
    max-width: none;
    border-radius: 10px;
    padding: 0 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.painel-shell .painel-row .col-duracao {
    color: var(--pl-muted);
}

.painel-shell .painel-atraso {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: #DC2626;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18), 0 0 18px rgba(220, 38, 38, 0.35);
}

/* Footer */
.painel-shell .painel-footer {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 0;
    background: var(--pl-surface);
    border: 1px solid var(--pl-border);
    border-radius: 14px;
    padding: 0.55rem 0.35rem 0.5rem;
    margin-top: 0;
    box-shadow: var(--pl-shadow);
    min-height: 0;
}

.painel-shell .painel-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.18rem;
    padding: 0.1rem 0.45rem 0.05rem;
    min-height: 0;
    flex: 1 1 0;
    min-width: 0;
    border-left: 1px solid var(--pl-border);
}

.painel-shell .painel-stat:first-child {
    border-left: 0;
}

.painel-shell .painel-stat-total .fa-truck,
.painel-shell .painel-stat-total svg {
    color: var(--pl-muted);
    font-size: 0.85rem;
    width: 1em;
    height: 1em;
}

.painel-shell .painel-stat-num {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-height: 1.45rem;
}

.painel-shell .painel-stat span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    width: 100%;
    max-height: 2.3em;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--pl-muted);
    white-space: normal;
    text-align: center;
    line-height: 1.15;
}

.painel-shell .painel-stat span small {
    font-size: 0.92em;
    font-weight: 600;
    letter-spacing: 0;
}

.painel-shell .painel-stat strong {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--pl-text-strong);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.02em;
}

.painel-shell .painel-tagline {
    margin-left: 0.15rem;
    display: flex;
    align-items: center;
    flex: 0 1 11.5rem;
    max-width: 12.5rem;
    gap: 0.4rem;
    color: var(--pl-muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    padding-left: 0.7rem;
    border-left: 1px solid var(--pl-border);
}

.painel-shell .painel-tagline .fa-circle-check,
.painel-shell .painel-tagline svg {
    color: #22C55E;
    font-size: 0.95rem;
    width: 1em;
    height: 1em;
}

body.pl-embed .painel-shell .painel-board {
    padding: 8px 20px 12px;
}

@media (max-width: 1199.98px) {
    .painel-shell {
        height: auto;
        min-height: calc(100dvh - var(--pl-topnav-h, 64px));
        overflow: auto;
    }

    .painel-shell .painel-board {
        height: auto;
        min-height: calc(100dvh - var(--pl-topnav-h, 64px));
        padding: 12px;
        overflow: visible;
    }

    .painel-shell .painel-legend {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.3rem 0.7rem;
        font-size: 0.72rem;
    }

    .painel-shell .painel-head {
        display: none;
    }

    .painel-shell .painel-table {
        overflow: visible;
    }

    .painel-shell .painel-body {
        overflow: visible;
        gap: 0.55rem;
    }

    .painel-shell .painel-row {
        flex: 0 0 auto;
        min-width: 0;
        min-height: 0;
        align-items: stretch;
        overflow: visible;
    }

    .painel-shell .painel-row .painel-cols {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.45rem 0.4rem;
        padding: 0.7rem 0.75rem 0.65rem 1rem;
        align-items: start;
    }

    .painel-shell .painel-row .col-doca {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0.3rem 0.5rem;
        flex-wrap: wrap;
    }

    #container_events_painel.painel-docas .painel-row .col-doca {
        grid-column: 1 / 2;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    #container_events_painel.painel-docas .painel-row .col-status {
        grid-column: 2 / -1;
        grid-row: 1;
        justify-content: flex-end;
    }

    #container_events_painel.painel-docas .painel-row .col-status::before,
    #container_events_painel.painel-docas .painel-row .col-doca::before {
        display: none;
    }

    #container_events_painel.painel-docas .col-status .painel-badge {
        width: fit-content;
        max-width: 100%;
        height: auto;
    }

    .painel-shell .painel-doca-nome {
        font-size: 1.05rem;
        min-width: 0;
    }

    .painel-shell .painel-row .col-status {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .painel-shell .painel-row .col-doca {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.3rem 0.5rem;
    }

    .painel-shell .painel-row .painel-badge,
    .painel-shell .painel-row .col-status .painel-badge,
    .painel-shell.agente-board .painel-row .col-status .painel-badge,
    .painel-shell.portaria-board .painel-row .col-status .painel-badge,
    .painel-shell.rm-board .painel-row .col-status .painel-badge,
    .painel-shell.od-board .painel-row .col-status .painel-badge,
    .painel-shell.coord-board .painel-row .col-status .painel-badge,
    .painel-shell.gp-board .painel-row .col-status .painel-badge,
    .painel-shell .painel-row .col-doca .painel-badge,
    #container_events_painel.painel-docas .painel-row .col-status .painel-badge {
        width: fit-content;
        max-width: 100%;
        height: auto;
        min-height: 1.5rem;
        padding: 0.2rem 0.62rem;
        border-radius: 999px;
        font-size: 0.7rem;
        font-weight: 700;
        line-height: 1.25;
        white-space: normal;
        text-align: left;
        justify-content: flex-start;
        overflow: visible;
        text-overflow: unset;
    }

    .painel-shell .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 .painel-row .col-placa,
    .painel-shell .painel-row .col-id,
    .painel-shell .painel-row .col-forn {
        text-align: left;
        white-space: normal;
        overflow: hidden;
        text-overflow: unset;
        letter-spacing: 0;
    }

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

    .painel-shell .painel-row .col-id {
        grid-column: 3 / -1;
        grid-row: 2;
        text-align: right;
    }

    .painel-shell .painel-row .col-id::before {
        text-align: right;
    }

    .painel-shell .painel-row .col-forn {
        grid-column: 1 / -1;
        grid-row: 3;
        font-size: 0.95rem;
    }

    .painel-shell .painel-row .col-tempo,
    .painel-shell .painel-row .col-duracao {
        grid-row: 4;
        grid-column: span 1;
        text-align: center;
        font-size: 0.82rem;
        padding: 0.32rem 0.2rem 0.28rem;
        border-radius: 10px;
        background: rgba(148, 163, 184, 0.1);
        border: 1px solid var(--pl-border);
    }

    .painel-shell .painel-row .col-tempo::before,
    .painel-shell .painel-row .col-duracao::before {
        text-align: center;
    }

    .painel-shell .painel-atraso {
        white-space: normal;
        justify-content: center;
        box-shadow: none;
        font-size: 0.75rem;
        padding: 0.12rem 0.35rem;
    }

    .painel-shell .painel-footer {
        flex-wrap: wrap;
        overflow: visible;
        gap: 0.45rem 0;
        padding: 0.55rem 0.45rem 0.45rem;
    }

    .painel-shell .painel-stat {
        flex: 1 1 18%;
        min-width: 6.2rem;
        border-left: 0;
        padding: 0.15rem 0.35rem;
    }

    .painel-shell .painel-tagline {
        flex: 1 1 100%;
        max-width: none;
        margin-left: 0;
        padding: 0.45rem 0.35rem 0.15rem;
        border-left: 0;
        border-top: 1px solid var(--pl-border);
    }
}

/* Modais no board: herdam o tema do body, não a folha branca do Bootstrap/gp-tela. */
body.painel-board-active .modal {
    --bs-modal-bg: var(--pl-surface);
    --bs-modal-color: var(--pl-text);
    --bs-modal-border-color: var(--pl-border);
    --bs-modal-header-border-color: var(--pl-border);
    --bs-modal-footer-border-color: var(--pl-border);
    --bs-body-color: var(--pl-text);
    --bs-body-bg: var(--pl-surface);
    color: var(--pl-text);
}

body.painel-board-active.painel-theme-dark .modal {
    color-scheme: dark;
}

body.painel-board-active.painel-theme-light .modal {
    color-scheme: light;
}

body.painel-board-active .modal-content,
body.painel-board-active .gp-tela.modal-content {
    background: var(--pl-surface);
    color: var(--pl-text);
    border: 1px solid var(--pl-border);
    border-radius: 16px;
}

body.painel-board-active .modal-header,
body.painel-board-active .modal-footer,
body.painel-board-active .gp-tela .modal-header,
body.painel-board-active .gp-tela .modal-footer {
    background: var(--pl-surface);
    border-color: var(--pl-border);
    color: var(--pl-text);
}

body.painel-board-active .modal-title,
body.painel-board-active .modal h4,
body.painel-board-active .modal h5,
body.painel-board-active .gp-tela .modal-title,
body.painel-board-active .gp-tela h5,
body.painel-board-active .gp-hero strong,
body.painel-board-active .gp-topo b,
body.painel-board-active .gp-grid b,
body.painel-board-active .gp-tempo strong {
    color: var(--pl-text-strong);
}

body.painel-board-active .gp-kicker,
body.painel-board-active .gp-hero span,
body.painel-board-active .gp-topo span,
body.painel-board-active .gp-grid span,
body.painel-board-active .gp-relato small {
    color: var(--pl-muted);
}

body.painel-board-active .gp-grid > div,
body.painel-board-active .gp-tempo,
body.painel-board-active .gp-relato {
    background: var(--pl-chip-bg);
    border-color: var(--pl-border);
}

body.painel-board-active .modal .form-control,
body.painel-board-active .modal .form-select {
    background: var(--pl-chip-bg);
    color: var(--pl-text);
    border-color: var(--pl-chip-border);
}

body.painel-board-active .modal .form-control:focus,
body.painel-board-active .modal .form-select:focus {
    background: var(--pl-chip-bg);
    color: var(--pl-text);
    border-color: #D84D15;
    box-shadow: 0 0 0 0.2rem rgba(216, 77, 21, 0.25);
}

body.painel-board-active .modal .form-floating > label {
    color: var(--pl-muted);
}

body.painel-board-active .modal .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--pl-text);
    --bs-table-striped-bg: rgba(148, 163, 184, 0.1);
    --bs-table-striped-color: var(--pl-text);
    --bs-table-hover-bg: rgba(216, 77, 21, 0.12);
    --bs-table-hover-color: var(--pl-text-strong);
    --bs-table-border-color: var(--pl-border);
    color: var(--pl-text);
}

body.painel-board-active.painel-theme-dark .modal .btn-close {
    filter: invert(1) grayscale(1) brightness(1.8);
    opacity: 0.85;
}

body.painel-board-active .modal .bg-white,
body.painel-board-active .modal .bg-light {
    background: var(--pl-chip-bg) !important;
    color: var(--pl-text-strong) !important;
}

body.painel-board-active.painel-theme-dark .modal .bg-dark,
body.painel-board-active.painel-theme-dark .modal .text-dark {
    background: var(--pl-chip-bg) !important;
    color: var(--pl-text-strong) !important;
}

body.painel-board-active .gp-evento {
    border-bottom-color: var(--pl-border);
}

body.painel-board-active .gp-evento-passo {
    background: var(--pl-chip-bg);
    color: var(--pl-text-strong);
    border: 1px solid var(--pl-border);
}

body.painel-board-active.painel-theme-dark .gp-tempo.is-total {
    background: #D84D15;
    border-color: #D84D15;
    color: #fff;
}

body.painel-board-active .gp-tabela {
    color: var(--pl-text);
}

body.painel-board-active .gp-tabela th,
body.painel-board-active .gp-tabela td {
    border-color: var(--pl-border);
    color: var(--pl-text);
}
