/*
 * PORT - Camada visual corporativa adicional
 * Objetivo: refinamento estético sem alteração estrutural/funcional.
 * Tokens definidos em base.css (--app-*).
 */

/* Tipografia e hierarquia */
h1, h2, h3, .h1, .h2, .h3 {
    letter-spacing: -0.03em;
}

h4, h5, h6, .h4, .h5, .h6 {
    letter-spacing: -0.02em;
}

.page-header {
    padding-bottom: 0.8rem;
    margin-bottom: 1.35rem !important;
}

.page-subtitle {
    font-size: .92rem;
    color: var(--app-text-muted);
}

/* Navegação */
#sidebar-wrapper {
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 44%, #111c34 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.2) !important;
}

#sidebar-wrapper .sidebar-heading {
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

#sidebar-wrapper .list-group-item {
    margin: 0.18rem 0.5rem;
    border-radius: 0.75rem;
    border-left: 0 !important;
    padding: 0.72rem 0.95rem;
    transition: var(--app-transition);
}

#sidebar-wrapper .list-group-item:hover {
    transform: translateX(4px);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.04));
}

#sidebar-wrapper .list-group-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.34), rgba(30, 64, 175, 0.14));
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4);
}

.sidebar-nav-groups {
    padding-bottom: 0.5rem;
}

.sidebar-nav-group-toggle {
    width: calc(100% - 1rem);
    margin: 0.35rem 0.5rem 0.15rem;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: rgba(148, 163, 184, 0.12);
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-nav-group-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
}

.sidebar-nav-group .collapse .list-group-item {
    margin-left: 0.25rem;
    margin-right: 0.35rem;
    font-size: 0.92rem;
}

.sidebar-nav-logout {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    margin-top: 0.5rem !important;
}

.kpi-card--link {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card--link:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-shadow-md);
}

.kpi-card--link .kpi-open-hint {
    font-size: 0.7rem;
    opacity: 0.65;
}

.card-metric--link {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.card-metric--link:hover {
    transform: translateY(-2px);
}

.port-quick-links .btn {
    font-size: 0.85rem;
}

.import-tab-advanced {
    display: none;
}

body.import-show-advanced .import-tab-advanced {
    display: list-item;
}

.navbar {
    border-bottom: 1px solid var(--app-border) !important;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

/* Cartões e blocos */
.card,
.tabela-container {
    border-radius: var(--app-radius-lg);
    border-color: var(--app-border);
    box-shadow: var(--app-shadow-sm);
}

.card:hover,
.tabela-container:hover {
    box-shadow: var(--app-shadow-md);
}

.card-header {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.port-main-card {
    border: 1px solid var(--app-border);
}

/* Redimensionar colunas — Pedidos / Ocorrências */
body.col-resize-active {
    cursor: col-resize !important;
    user-select: none;
}

#tabelaPedidos thead tr:not(.filters) th.th-col-resizable,
#tabelaPedidos thead tr:not(.filters) th:has(.col-resize-handle) {
    position: relative;
    overflow: hidden;
}

#tabelaPedidos .col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    z-index: 3;
    touch-action: none;
}

#tabelaPedidos .col-resize-handle:hover,
#tabelaPedidos .col-resize-handle.active {
    background: rgba(37, 99, 235, 0.28);
}

#tabelaPedidos.table-has-custom-col-widths {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

#tabelaPedidos.table-has-custom-col-widths thead tr:not(.filters) th.th-col-resizable,
#tabelaPedidos.table-has-custom-col-widths tbody td {
    box-sizing: border-box;
}

.kpi-card {
    cursor: pointer;
    border: 1px solid var(--app-border);
    border-left-width: 4px;
}

.kpi-card:hover {
    transform: translateY(-3px);
}

.kpi-card.active {
    box-shadow: var(--app-shadow-md);
}

.kpi-card--pendente { border-left-color: #f59e0b; }
.kpi-card--tratativa { border-left-color: #2563eb; }
.kpi-card--aguardando { border-left-color: #0ea5e9; }
.kpi-card--atraso { border-left-color: #475569; }
.kpi-card--resolvido { border-left-color: #16a34a; }
.kpi-card--recusa { border-left-color: #dc2626; }
.kpi-card--total { border-left-color: #1d4ed8; }

/* Dashboard */
.card-metric {
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-sm);
}

.card-metric::before {
    width: 5px;
    opacity: 0.95;
}

.card-metric:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow-lg);
}

.card-metric.danger { color: var(--danger-color, #dc3545); }

.metric-label {
    font-size: .74rem;
}

.metric-value {
    font-size: clamp(1.65rem, 2vw, 2.1rem);
}

.port-dash-value-sm {
    font-size: clamp(1.1rem, 1.6vw, 1.45rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.metric-value--count {
    font-size: clamp(1.25rem, 1.8vw, 1.55rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.metric-sub {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.35rem;
    line-height: 1.35;
    font-weight: 500;
}

.port-dash-metric-body {
    padding: 1rem 1.15rem !important;
    min-height: 92px;
}

.port-dash-metric-body > .d-flex {
    align-items: center !important;
    width: 100%;
}

#miniDashboard .metric-icon,
.port-dash-compras .metric-icon {
    font-size: 1.85rem;
    right: 0.85rem;
    opacity: 0.12;
}

.port-dash-compras .card-header {
    background: #fff;
    border-bottom: 1px solid var(--app-border, #e2e8f0);
}

.port-dash-compras .port-dash-kpis {
    margin-bottom: 0;
}

.port-compras-metrics-panel {
    border: 1px solid #e5e7eb;
    box-shadow: none;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
}

.port-compras-metrics-panel .card-header {
    background: #fff;
    border-bottom: 1px solid #eef2f7;
}

.port-compras-metrics-panel .card-body {
    background: #fff;
    padding: 0.75rem !important;
}

.port-compras-metrics-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
}

.port-compras-metric-item {
    flex: 1 1 0;
    min-width: 0;
}

.port-compras-metrics-row--compact .port-compras-metric-item {
    min-width: 100px;
}

.port-compras-metrics-row--compact .port-dash-occ-tile {
    width: 100%;
    height: 100%;
    padding: 0.62rem 0.75rem;
}

.port-compras-metrics-row--compact .port-dash-occ-label {
    font-size: 0.64rem;
}

.port-compras-metrics-row--compact .port-dash-occ-value {
    font-size: 1.2rem;
}

.port-compras-metrics-row--compact .port-dash-occ-value--money {
    font-size: 0.86rem;
}

.port-compras-metrics-row--compact .port-dash-occ-sub {
    font-size: 0.62rem;
}

.port-compras-metrics-panel.is-cliente .port-compras-metric--financeiro {
    display: none !important;
}

/* Compras — filtros e status */
.compras-page .compras-toolbar-card {
    border: 1px solid #e5e7eb;
    box-shadow: none;
    border-radius: 0.75rem;
}

.compras-filters-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.compras-filter-field {
    flex: 0 0 auto;
}

.compras-filter-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.compras-filter-field--tipo { min-width: 168px; }
.compras-filter-field--date { min-width: 142px; }
.compras-filter-field--cc { min-width: 128px; }

.compras-filter-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-bottom: 1px;
}

.compras-page .port-dash-occ-tile.kpi-card {
    cursor: pointer;
    width: 100%;
    user-select: none;
}

.compras-page .port-dash-occ-tile.kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--app-shadow-md);
}

.compras-page .port-dash-occ-tile.kpi-card.active {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.28);
    background: #f8fafc;
}

@media (min-width: 1200px) {
    .compras-status-row[class*="row-cols-xl-"] > .col {
        flex: 1 1 0;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 1199.98px) {
    .port-compras-metrics-row {
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }

    .port-compras-metrics-row--compact .port-compras-metric-item {
        flex: 0 0 auto;
        min-width: 118px;
    }
}

.port-dash-mini {
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-sm);
    border-radius: var(--app-radius-lg);
}

.port-dash-occ-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.75rem 1rem;
    border-radius: var(--app-radius-md, 0.5rem);
    border: 1px solid var(--app-border);
    background: #fff;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.port-dash-occ-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-shadow-md);
    color: inherit;
}

.port-dash-occ-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.port-dash-occ-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.port-dash-occ-tile--pendente { border-left: 4px solid #f59e0b; }
.port-dash-occ-tile--tratativa { border-left: 4px solid #2563eb; }
.port-dash-occ-tile--atraso { border-left: 4px solid #dc2626; }
.port-dash-occ-tile--aguardando { border-left: 4px solid #0ea5e9; }
.port-dash-occ-tile--resolvido { border-left: 4px solid #16a34a; background: #f8fafc; }
.port-dash-occ-tile--total { border-left: 4px solid #475569; background: #f8fafc; }

.port-dash-occ-tile--compras-qtd { border-left: 4px solid #dc2626; }
.port-dash-occ-tile--compras-resmas { border-left: 4px solid #ef4444; }
.port-dash-occ-tile--compras-total { border-left: 4px solid #16a34a; }
.port-dash-occ-tile--compras-ctis { border-left: 4px solid #f59e0b; }
.port-dash-occ-tile--compras-ticket { border-left: 4px solid #d97706; }
.port-dash-occ-tile--compras-diff { border-left: 4px solid #059669; background: #f8fafc; }

.port-dash-occ-value--money {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.port-dash-occ-sub {
    display: block;
    font-size: 0.68rem;
    color: #b45309;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 0.15rem;
}
.port-dash-situacao-card--zero {
    opacity: 0.72;
}

.port-dash-situacao-card--zero .metric-value {
    color: #94a3b8 !important;
}

.port-dash-insight-group {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg, 0.65rem);
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.port-dash-insight-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--app-border);
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

.port-dash-insight-group-head .bi {
    font-size: 1.1rem;
    color: #2563eb;
}

.port-dash-insight-group-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.port-dash-insight-group-body .port-dash-topic {
    margin: 0;
}

.port-dash-insight-card .card-header h6 {
    color: #0f172a;
}

.port-dash-insight-topicos-inner {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.port-dash-insight-card--comprovantes .port-dash-insight-topicos-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

@media (min-width: 768px) {
    .port-dash-insight-card--comprovantes .port-dash-insight-topicos-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1200px) {
    .port-dash-insight-card--port .port-dash-insight-topicos-inner {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
}

.port-dash-topic {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg, 0.65rem);
    background: #fff;
    padding: 1rem 1.1rem 0.85rem;
    height: 100%;
    box-shadow: var(--app-shadow-sm);
    border-top: 4px solid #94a3b8;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.port-dash-topic:hover {
    box-shadow: var(--app-shadow-md);
    transform: translateY(-2px);
}

.port-dash-topic--clickable {
    cursor: pointer;
}

.port-dash-topic--clickable:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.port-dash-topic--clickable:hover .port-dash-topic-foot .text-primary {
    text-decoration: underline;
}

#tabelaInsightPedidos .insight-pedido-row:hover {
    background-color: #f1f5f9;
}

.port-dash-topic-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem 0.75rem;
    align-items: start;
}

.port-dash-topic-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: #f1f5f9;
    color: #334155;
}

.port-dash-topic-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.port-dash-topic-desc {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.35;
    margin-top: 0.15rem;
}

.port-dash-topic-qty {
    text-align: right;
    line-height: 1.1;
}

.port-dash-topic-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.port-dash-topic-resmas {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0.15rem;
    color: #0369a1;
}

.port-dash-topic-pct {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.port-dash-topic-chart {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.75rem 0 0.45rem;
}

.port-dash-topic-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    min-width: 2px;
    transition: width 0.35s ease;
}

.port-dash-topic-foot {
    font-size: 0.68rem;
}

.port-dash-topic--warn { border-top-color: #f59e0b; }
.port-dash-topic--warn .port-dash-topic-bar { background: linear-gradient(90deg, #fbbf24, #d97706); }
.port-dash-topic--primary { border-top-color: #2563eb; }
.port-dash-topic--success { border-top-color: #16a34a; }
.port-dash-topic--success .port-dash-topic-bar { background: linear-gradient(90deg, #4ade80, #16a34a); }
.port-dash-topic--danger { border-top-color: #dc2626; }
.port-dash-topic--danger .port-dash-topic-bar { background: linear-gradient(90deg, #f87171, #dc2626); }
.port-dash-topic--info { border-top-color: #0ea5e9; }
.port-dash-topic--info .port-dash-topic-bar { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.port-dash-topic--muted { border-top-color: #94a3b8; }
.port-dash-topic--muted .port-dash-topic-bar { background: linear-gradient(90deg, #cbd5e1, #64748b); }

.port-dash-rank-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg, 0.65rem);
    overflow: hidden;
}

.port-dash-rank-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--app-border);
}

.port-dash-rank-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.port-dash-rank-card--uf .port-dash-rank-card-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.port-dash-rank-card--proj .port-dash-rank-card-icon {
    background: #fef3c7;
    color: #b45309;
}

.port-dash-rank-card--city .port-dash-rank-card-icon {
    background: #d1fae5;
    color: #047857;
}

.port-dash-rank-list {
    padding: 0.35rem 0;
}

.port-dash-rank-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: 0.85rem;
}

.port-dash-rank-item {
    padding: 0.65rem 1rem 0.7rem;
    border-bottom: 1px solid #f1f5f9;
}

.port-dash-rank-item:last-child {
    border-bottom: none;
}

.port-dash-rank-item--top1 {
    background: linear-gradient(90deg, rgba(254, 243, 199, 0.35) 0%, transparent 100%);
}

.port-dash-rank-item--top2 {
    background: linear-gradient(90deg, rgba(241, 245, 249, 0.8) 0%, transparent 100%);
}

.port-dash-rank-item-row {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    gap: 0.5rem 0.65rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

.port-dash-rank-pos {
    display: flex;
    align-items: center;
    justify-content: center;
}

.port-dash-rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.port-dash-rank-medal--1 {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #78350f;
}

.port-dash-rank-medal--2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #334155;
}

.port-dash-rank-medal--3 {
    background: linear-gradient(135deg, #fed7aa, #ea580c);
    color: #7c2d12;
}

.port-dash-rank-medal--plain {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 700;
}

.port-dash-rank-label-wrap {
    min-width: 0;
}

.port-dash-rank-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.port-dash-rank-sub {
    display: block;
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 0.1rem;
}

.port-dash-rank-qty {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}

.port-dash-rank-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.port-dash-rank-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
}

.port-dash-rank-bar--uf .port-dash-rank-bar-fill {
    background: linear-gradient(90deg, #60a5fa, #1d4ed8);
}

.port-dash-rank-bar--proj .port-dash-rank-bar-fill {
    background: linear-gradient(90deg, #fbbf24, #d97706);
}

.port-dash-rank-bar--city .port-dash-rank-bar-fill {
    background: linear-gradient(90deg, #34d399, #059669);
}

.port-dash-rank-bar--primary .port-dash-rank-bar-fill {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

/* Dashboard — barra de tempo (filtro por meses) */
.port-dash-timeline-card {
    background: #fff;
}

.port-dash-timeline-selected {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.85rem;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

.port-dash-timeline-selected .port-dash-timeline-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #e7f1ff;
    color: #1d4ed8;
    border: 1px solid #bfd4f8;
    font-size: 0.78rem;
    font-weight: 600;
}

.port-dash-timeline-track {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 3px;
    padding: 0.75rem 0.65rem 1rem;
    background: #f1f5f9;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.port-dash-timeline-track::after {
    content: '';
    position: absolute;
    left: 0.65rem;
    right: 0.65rem;
    bottom: 0.5rem;
    height: 2px;
    background: #cbd5e1;
    border-radius: 999px;
    pointer-events: none;
}

.port-dash-timeline-month {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    min-width: 58px;
    padding: 0.45rem 0.35rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.port-dash-timeline-month:hover {
    color: #334155;
    background: #e2e8f0;
}

.port-dash-timeline-month:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.port-dash-timeline-month.is-selected {
    color: #1d4ed8;
    background: #fff;
    border-color: #93c5fd;
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.1);
}

.port-dash-timeline-month.is-selected::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -0.4rem;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: #1d4ed8;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #93c5fd;
}

.port-dash-timeline-loading {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
    color: #94a3b8 !important;
}

.port-dash-timeline-hint kbd {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
}

.port-dash-rank-card--city .port-dash-rank-card-icon {
    background: #d1fae5;
    color: #047857;
}

.port-dash-rank-card--sla .port-dash-rank-card-icon {
    background: #dcfce7;
    color: #15803d;
}

.port-dash-rank-card--transp .port-dash-rank-card-icon,
.port-dash-rank-card--detail .port-dash-rank-card-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.port-dash-rank-bar--success .port-dash-rank-bar-fill {
    background: linear-gradient(90deg, #4ade80, #16a34a);
}

.port-dash-rank-bar--transp .port-dash-rank-bar-fill {
    background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.port-dash-transp-search {
    max-width: 280px;
}

.port-dash-transp-table thead th {
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.port-dash-transp-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.port-dash-transp-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.04), rgba(37, 99, 235, 0.01));
}

.port-dash-transp-carrier {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.port-dash-transp-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.port-dash-transp-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.port-dash-transp-logo--md {
    width: 44px;
    height: 44px;
    padding: 4px;
}

.port-dash-transp-logo--sm {
    width: 30px;
    height: 30px;
    padding: 3px;
}

.port-dash-rank-label-wrap--logo {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.port-dash-rank-label-wrap--logo .port-dash-rank-label {
    flex: 1;
    min-width: 0;
}

.port-dash-transp-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
}

.port-dash-transp-avatar--sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.58rem;
}

.port-dash-transp-avatar--md {
    width: 44px;
    height: 44px;
}

.port-dash-transp-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.88rem;
    line-height: 1.2;
}

.port-dash-transp-sub {
    font-size: 0.72rem;
    color: #94a3b8;
}

.port-dash-transp-metric-main {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.9rem;
}

.port-dash-transp-metric-sub {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 0.1rem;
}

.port-dash-transp-sla-wrap {
    min-width: 180px;
}

.port-dash-transp-sla-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.port-dash-transp-sla-pct {
    font-size: 0.88rem;
    font-weight: 800;
}

.port-dash-transp-sla-pct.is-success { color: #16a34a; }
.port-dash-transp-sla-pct.is-warning { color: #d97706; }
.port-dash-transp-sla-pct.is-danger { color: #dc2626; }

.port-dash-transp-sla-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
}

.port-dash-transp-sla-badge.is-success { background: #dcfce7; color: #15803d; }
.port-dash-transp-sla-badge.is-warning { background: #fef3c7; color: #b45309; }
.port-dash-transp-sla-badge.is-danger { background: #fee2e2; color: #b91c1c; }

.port-dash-transp-sla-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.port-dash-transp-sla-bar-on {
    background: linear-gradient(90deg, #4ade80, #16a34a);
    transition: width 0.35s ease;
}

.port-dash-transp-sla-bar-off {
    background: linear-gradient(90deg, #f87171, #dc2626);
    transition: width 0.35s ease;
}

.port-dash-transp-sla-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.3rem;
    font-size: 0.68rem;
    color: #94a3b8;
}

.port-dash-transp-sla-foot span strong {
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .port-dash-transp-search {
        max-width: 100%;
        width: 100%;
    }
}

.port-dash-transp-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.port-dash-transp-row:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.02)) !important;
}

.port-dash-transp-chart-click {
    cursor: pointer;
    transition: background 0.15s ease;
}

.port-dash-transp-chart-click:hover {
    background: rgba(37, 99, 235, 0.04);
}

.port-dash-transp-sla-link {
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

.port-dash-transp-sla-link:hover {
    color: #2563eb !important;
}

.port-dash-transp-sla-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.port-dash-transp-sla-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    min-width: 7rem;
}

.port-dash-transp-sla-chip:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.port-dash-transp-sla-chip--active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background: #f8fbff;
}

.port-dash-transp-sla-chip-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.port-dash-transp-sla-chip-val {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.port-dash-transp-sla-chip--success .port-dash-transp-sla-chip-val { color: #15803d; }
.port-dash-transp-sla-chip--danger .port-dash-transp-sla-chip-val { color: #b91c1c; }
.port-dash-transp-sla-chip--primary .port-dash-transp-sla-chip-val { color: #1d4ed8; }
.port-dash-transp-sla-chip--warning .port-dash-transp-sla-chip-val { color: #b45309; }

/* Atrasos de Entrega */
.port-atrasos-page .port-atrasos-rules {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.port-atrasos-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 992px) {
    .port-atrasos-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.port-atrasos-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
    border-top: 3px solid #94a3b8;
}

.port-atrasos-kpi:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.port-atrasos-kpi.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.port-atrasos-kpi--total { border-top-color: #dc2626; }
.port-atrasos-kpi--light { border-top-color: #64748b; }
.port-atrasos-kpi--warn { border-top-color: #f59e0b; }
.port-atrasos-kpi--orange { border-top-color: #ea580c; }
.port-atrasos-kpi--danger { border-top-color: #b91c1c; }

.port-atrasos-kpi-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.port-atrasos-kpi-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.port-atrasos-cobranca-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.port-atrasos-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.port-atrasos-chip:hover { background: #f8fafc; }
.port-atrasos-chip.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
    font-weight: 600;
}

.port-atrasos-chip-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.port-atrasos-chip--warn.active { background: #fffbeb; border-color: #f59e0b; color: #b45309; }
.port-atrasos-chip--ok.active { background: #f0fdf4; border-color: #16a34a; color: #15803d; }
.port-atrasos-chip--info.active { background: #eff6ff; border-color: #2563eb; color: #1d4ed8; }
.port-atrasos-chip--danger.active { background: #fef2f2; border-color: #dc2626; color: #b91c1c; }
.port-atrasos-chip--inden.active { background: #fef2f2; border-color: #991b1b; color: #991b1b; }

.port-atrasos-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.85rem 1rem;
}

.port-atrasos-select { min-width: 200px; max-width: 240px; }
.port-atrasos-range { min-width: 220px; max-width: 280px; }
.port-atrasos-search { min-width: 260px; max-width: 420px; flex: 1 1 260px; }

.port-atrasos-table thead th {
    background: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.port-atrasos-table tbody td {
    font-size: 0.875rem;
    vertical-align: middle;
}

.port-atrasos-table tbody tr {
    cursor: pointer;
}

.port-atrasos-timeline-col {
    min-width: 170px;
    max-width: 220px;
}

.port-atrasos-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.port-atrasos-timeline-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.port-atrasos-timeline-dot--ok { background: #16a34a; }
.port-atrasos-timeline-dot--warn { background: #f59e0b; }
.port-atrasos-timeline-dot--danger { background: #dc2626; }
.port-atrasos-timeline-dot--info { background: #0ea5e9; }

.port-atrasos-chip--agenda-dia.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}

.port-atrasos-chip--promessa {
    border-color: #0ea5e9;
}

.port-atrasos-chip--promessa.active {
    background: #ecfeff;
    border-color: #0891b2;
    color: #0e7490;
}

.port-atrasos-cobranca-chips .port-atrasos-chip-label {
    margin-right: 0.15rem;
}

.port-atrasos-row--critico {
    background: rgba(254, 226, 226, 0.35) !important;
}

.bg-orange-subtle {
    background-color: #ffedd5 !important;
    color: #9a3412 !important;
}

.metric-icon {
    opacity: 0.2;
    filter: saturate(110%);
}

/* Tabelas / DataTables */
.table thead th {
    background: linear-gradient(180deg, #f8fbff 0%, #f2f6fc 100%);
    border-bottom: 1px solid var(--app-border);
    color: #334155;
    font-size: .73rem;
    padding-top: 0.88rem;
    padding-bottom: 0.88rem;
}

.table tbody td {
    padding-top: 0.88rem;
    padding-bottom: 0.88rem;
    border-color: #eaf0f7;
}

.table-hover tbody tr {
    transition: var(--app-transition);
}

.table-hover tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.07), rgba(59, 130, 246, 0.02));
}

.badge,
.badge-status,
.badge-pill {
    border-radius: 999px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .2);
}

.status-badge {
    border: 1px solid transparent;
    letter-spacing: .01em;
    padding: .36rem .62rem;
    font-size: .72rem;
}

.status-neutro { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.status-pendente { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.status-tratativa { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.status-aguardando { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.status-atraso { background: #e2e8f0; color: #0f172a; border-color: #94a3b8; }
.status-resolvido { background: #dcfce7; color: #166534; border-color: #86efac; }
.status-cancelado,
.status-saldo-recusa { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.status-devolucao { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }

.status-prazo-ok { background: #dcfce7; color: #166534; border-color: #86efac; }
.status-prazo-atrasado { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.status-prazo-alerta { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 0.65rem;
    min-height: 2.15rem;
    border-color: var(--app-border);
    background-color: #fff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.6rem !important;
    min-width: 2rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #1e40af !important;
    background: #eaf1ff !important;
    border-color: #b9cdf7 !important;
}

/* Formulários */
.form-label {
    color: #475569;
    letter-spacing: .01em;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: var(--app-radius-sm);
    border-color: var(--app-border);
    background-color: #fdfefe;
}

.form-control:hover,
.form-select:hover {
    border-color: #bfd0ec;
}

.form-control:focus,
.form-select:focus {
    border-color: #6ea8fe;
    box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.14);
}

.btn {
    border-radius: 0.62rem;
    font-weight: 600;
    transition: var(--app-transition);
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-primary-600), var(--app-primary));
    border-color: var(--app-primary);
}

.btn-primary:hover {
    filter: brightness(1.03);
}

.btn-port-primary {
    background: linear-gradient(135deg, var(--app-primary-600), var(--app-primary));
    border-color: var(--app-primary);
    color: #fff;
}

.btn-port-export {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border-color: #15803d;
    color: #fff;
}

.btn-port-neutral {
    border-color: #c7d2e5;
    color: #334155;
    background: #fff;
}

.btn-port-neutral:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-action-view {
    border: 1px solid #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.btn-action-view:hover {
    background: #dbeafe;
    color: #1e3a8a;
}

/* Microinterações */
.card,
.btn,
.form-control,
.form-select,
.list-group-item,
.paginate_button,
.dropdown-item {
    transition: var(--app-transition);
}

.dropdown-item:hover {
    background-color: #f1f6ff;
}

/* Dark theme refinado */
body.theme-dark {
    --app-border: #24324a;
    --app-text: #e2e8f0;
    --app-text-muted: #9fb0c8;
    background: radial-gradient(circle at top right, #0c1425 0%, #0b1220 46%, #0a101d 100%);
}

body.theme-dark #sidebar-wrapper {
    background: linear-gradient(180deg, #070d19 0%, #0b1220 46%, #111b32 100%);
}

body.theme-dark .card,
body.theme-dark .tabela-container,
body.theme-dark .navbar,
body.theme-dark .modal-content {
    border-color: #22324a !important;
    box-shadow: 0 8px 24px rgba(2, 8, 23, 0.45);
}

body.theme-dark .table thead th {
    background: linear-gradient(180deg, #101a2f 0%, #0d172a 100%);
    color: #d3deee;
}

body.theme-dark .table-hover tbody tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.06));
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .input-group-text {
    background-color: #0e182b;
    border-color: #273754;
}

body.theme-dark .dropdown-item:hover {
    background: rgba(59, 130, 246, 0.16);
}

body.theme-dark .btn-port-neutral {
    background: #0e182b;
    border-color: #334155;
    color: #cbd5e1;
}

body.theme-dark .btn-action-view {
    background: #10203b;
    border-color: #1d4ed8;
    color: #bfdbfe;
}

/* Responsividade */
@media (max-width: 991.98px) {
    .container-fluid.px-5.py-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }

    .card-header,
    .card-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 767.98px) {
    .metric-value {
        font-size: 1.35rem;
    }

    .metric-icon {
        font-size: 1.6rem;
        opacity: .22;
    }

    .table thead th,
    .table tbody td {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    #sidebar-wrapper .list-group-item {
        margin-left: .35rem;
        margin-right: .35rem;
    }
}

/* Busca global no navbar */
.port-global-search {
    max-width: 32rem;
}

/* Faixa de seleção fixa no viewport (Pedidos / Ocorrências) — fora do #wrapper */
#portSelectionBar.port-selection-bar {
    display: none !important;
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0;
    width: 100%;
    z-index: 1030 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(8px);
    transform: none !important;
}
#portSelectionBar.port-selection-bar.is-visible {
    display: block !important;
}
body.modal-open #portSelectionBar.port-selection-bar {
    display: none !important;
}
.port-selection-bar-inner {
    padding: 0.7rem 1.25rem;
    max-width: 100%;
}
.port-selection-count {
    font-size: 0.95rem;
    font-weight: 600;
}
body.port-has-selection-bar {
    padding-bottom: 4.25rem;
}
body.port-has-selection-bar #page-content-wrapper .container-fluid:last-of-type {
    padding-bottom: 0.5rem;
}
body.theme-dark .port-selection-bar {
    background: rgba(15, 23, 42, 0.97);
}

.port-table-search-group {
    min-width: min(100%, 22rem);
}

/* Modal pedido: timeline fixa + alterações não salvas */
.modal-pedido-body {
    max-height: min(78vh, 720px);
}
.modal-pedido-timeline-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
}
#pedidoTabs .nav-link.port-tab-has-unsaved::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: #f59e0b;
    vertical-align: middle;
}
#pedidoTabs .nav-link.port-tab-switch-dirty {
    box-shadow: inset 0 -2px 0 #f59e0b;
}

/* Histórico de cotações */
.historico-cotacoes-page .historico-kpi {
    border: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.historico-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.85;
}
.historico-kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0.15rem;
}
.historico-kpi-pct {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.75;
}
.historico-kpi-sub {
    font-size: 0.78rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}
.historico-kpi--total { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #1e3a8a; }
.historico-kpi--ok { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #065f46; }
.historico-kpi--err { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #991b1b; }
.historico-kpi--hoje { background: linear-gradient(135deg, #fff7ed, #ffedd5); color: #9a3412; }
.historico-kpi--media { background: linear-gradient(135deg, #f5f3ff, #ede9fe); color: #5b21b6; }

.historico-filtros-card .card-header {
    background: linear-gradient(90deg, #f8fafc, #fff);
}

.historico-cotacoes-table thead th {
    background: #f1f5f9;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.historico-cotacoes-table tbody tr.historico-row--ok {
    border-left: 3px solid #22c55e;
}
.historico-cotacoes-table tbody tr.historico-row--err {
    border-left: 3px solid #ef4444;
    background: rgba(254, 242, 242, 0.35);
}
.historico-cotacoes-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}
.historico-pedido-gprint {
    display: block;
    font-weight: 700;
    color: #0f172a;
}
.historico-pedido-meta {
    display: inline-block;
    font-size: 0.75rem;
    color: #64748b;
    margin-right: 0.5rem;
}
.historico-destino {
    font-size: 0.88rem;
    color: #334155;
}
.historico-destinatario-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 10rem;
}
.historico-destino-cidade {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
}
.historico-destino-meta {
    font-size: 0.75rem;
    color: #64748b;
}
.historico-medidas-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 7.5rem;
}
.historico-medidas-principal {
    font-size: 0.88rem;
    font-weight: 700;
    color: #9a3412;
}
.historico-medidas-meta {
    font-size: 0.75rem;
    color: #64748b;
}
.historico-detalhe-item--medidas {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
}
.historico-acoes-cell {
    display: inline-flex;
    gap: 0.25rem;
}
.historico-api-swal .historico-api-bloco-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.35rem;
}
.historico-api-envio,
.historico-api-mensagem,
.historico-api-resposta {
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 18rem;
    overflow: auto;
}
.historico-api-envio {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.historico-api-mensagem {
    background: #ecfdf5;
    border-color: #a7f3d0;
    font-weight: 700;
}
.historico-detalhe-item--dest {
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border-color: #bfdbfe;
}
.historico-destinatario-destaque .historico-detalhe-valor {
    font-weight: 600;
}
.historico-col-valor {
    font-weight: 700;
    white-space: nowrap;
}
.historico-valor--ok {
    color: #15803d;
}
.historico-badge-transp {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: var(--transp-color, #64748b);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.historico-badge-origem {
    font-size: 0.72rem;
    font-weight: 600;
}
.historico-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.historico-status--ok { color: #16a34a; }
.historico-status--err { color: #dc2626; }
.historico-col-data,
.historico-col-user {
    font-size: 0.85rem;
    color: #475569;
}
.historico-col-cotacao {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
}
.historico-acoes-cell .btn-group {
    flex-wrap: nowrap;
}

.historico-modal-header--ok {
    background: linear-gradient(90deg, #ecfdf5, #fff) !important;
    border-bottom-color: #bbf7d0 !important;
}
.historico-modal-header--err {
    background: linear-gradient(90deg, #fef2f2, #fff) !important;
    border-bottom-color: #fecaca !important;
}
.historico-modal-resumo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}
.historico-modal-resumo.historico-modal-header--ok {
    background: #f0fdf4;
}
.historico-modal-resumo.historico-modal-header--err {
    background: #fef2f2;
}
.historico-detalhe-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem;
}
.historico-detalhe-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
}
.historico-detalhe-valor {
    margin-top: 0.2rem;
    font-size: 0.92rem;
    color: #0f172a;
    word-break: break-word;
}
.historico-json-pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 0;
}

body.theme-dark .historico-kpi--total { background: linear-gradient(135deg, #1e3a5f, #1e293b); color: #bfdbfe; }
body.theme-dark .historico-kpi--ok { background: linear-gradient(135deg, #14532d, #1e293b); color: #bbf7d0; }
body.theme-dark .historico-kpi--err { background: linear-gradient(135deg, #7f1d1d, #1e293b); color: #fecaca; }
body.theme-dark .historico-kpi--hoje { background: linear-gradient(135deg, #7c2d12, #1e293b); color: #fed7aa; }
body.theme-dark .historico-kpi--media { background: linear-gradient(135deg, #4c1d95, #1e293b); color: #ddd6fe; }
body.theme-dark .historico-cotacoes-table thead th { background: #1e293b; color: #cbd5e1; }
body.theme-dark .historico-cotacoes-table tbody tr.historico-row--err { background: rgba(127, 29, 29, 0.2); }
body.theme-dark .historico-detalhe-item { background: #1e293b; border-color: #334155; }
body.theme-dark .historico-detalhe-valor { color: #f1f5f9; }
body.theme-dark .historico-pedido-gprint { color: #f8fafc; }
/* UX03/RN18 - padrão administrativo global */
:root {
  --port-bg: #f5f7fb;
  --port-surface: #ffffff;
  --port-line: #dbe4ef;
  --port-text: #111827;
  --port-muted: #64748b;
  --port-primary: #1d4ed8;
  --port-accent: #0f766e;
  --port-warning: #b45309;
}

body {
  background: var(--port-bg);
  color: var(--port-text);
}

.port-homolog-strip {
  align-items: center;
  background: #7f1d1d;
  color: #fff;
  display: flex;
  font-size: 12px;
  gap: 12px;
  justify-content: center;
  letter-spacing: .01em;
  min-height: 28px;
  padding: 4px 12px;
  position: sticky;
  top: 0;
  z-index: 2147483647;
}

.port-homolog-strip strong {
  font-weight: 600;
  opacity: .88;
}

.port-env-pill {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  padding: 6px 10px;
  text-transform: uppercase;
}

#wrapper {
  min-height: calc(100vh - 28px);
}

#sidebar-wrapper {
  background: #0f172a;
  border-right: 0 !important;
  flex: 0 0 276px;
  margin-left: 0 !important;
  box-shadow: 8px 0 28px rgba(15, 23, 42, .12);
  min-height: calc(100vh - 28px);
  transition: width .18s ease, margin .18s ease;
  width: 276px;
}

.sidebar-heading {
  align-items: center;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 76px;
  padding: 14px 12px;
}

.port-sidebar-logo {
  background: #fff;
  border-radius: 8px;
  max-height: 42px;
  padding: 4px 8px;
}

.port-sidebar-brand {
  color: #e5e7eb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar-nav-groups {
  padding: 12px 10px 18px;
}

.sidebar-nav-group {
  margin-bottom: 8px;
}

.sidebar-nav-group-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #94a3b8;
  display: flex;
  font-size: 11px;
  font-weight: 800;
  justify-content: space-between;
  padding: 9px 10px;
  text-transform: uppercase;
  width: 100%;
}

.sidebar-nav-group-toggle .group-title,
.port-nav-link {
  align-items: center;
  display: flex;
  gap: 10px;
}

.sidebar-nav-group-toggle:hover {
  background: rgba(255, 255, 255, .06);
  color: #f8fafc;
}

.port-nav-link.list-group-item {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
  margin: 2px 0;
  min-height: 40px;
  padding: 9px 10px;
}

.port-nav-link.list-group-item:hover {
  background: rgba(59, 130, 246, .16);
  color: #fff;
}

.port-nav-link.list-group-item.active {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.sidebar-nav-logout {
  color: #fecaca !important;
}

body.sb-sidenav-toggled #sidebar-wrapper {
  flex-basis: 74px;
  margin-left: 0 !important;
  width: 74px;
}

body.sb-sidenav-toggled #sidebar-wrapper .nav-label,
body.sb-sidenav-toggled #sidebar-wrapper .port-sidebar-brand,
body.sb-sidenav-toggled #sidebar-wrapper .group-chevron {
  display: none;
}

body.sb-sidenav-toggled #sidebar-wrapper .sidebar-nav-group-toggle,
body.sb-sidenav-toggled #sidebar-wrapper .port-nav-link {
  justify-content: center;
}

#page-content-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.navbar {
  background: rgba(255, 255, 255, .94) !important;
  backdrop-filter: blur(12px);
}

.port-icon-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
}

.port-page-shell {
  max-width: 1920px;
}

.port-page-header {
  background: var(--port-surface);
  border: 1px solid var(--port-line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
  margin-bottom: 20px;
  padding: 18px 20px;
}

.port-breadcrumb {
  align-items: center;
  color: var(--port-muted);
  display: flex;
  font-size: 12px;
  gap: 8px;
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--port-muted);
  margin-top: 5px;
}

.port-admin-summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.port-summary-card {
  background: var(--port-surface);
  border: 1px solid var(--port-line);
  border-radius: 10px;
  padding: 16px;
}

.port-summary-card span {
  color: var(--port-muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.port-summary-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  margin-top: 6px;
}

.port-data-card {
  border: 1px solid var(--port-line);
  border-radius: 12px;
  overflow: hidden;
}

.port-data-card .table thead th {
  background: #eef4fb;
  color: #172033;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.port-filter-bar {
  align-items: center;
  background: var(--port-surface);
  border: 1px solid var(--port-line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) auto auto;
  padding: 12px;
}

.port-filter-bar-wide {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) minmax(110px, 150px) minmax(120px, 150px) auto auto;
}

.port-detail-panel {
  background: var(--port-surface);
  border: 1px solid var(--port-line);
  border-left: 4px solid var(--port-primary);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
  padding: 18px;
}

.port-detail-panel h3 {
  font-size: 22px;
  line-height: 1.2;
  margin: 3px 0 0;
}

.port-detail-stats,
.port-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.port-detail-grid {
  grid-template-columns: 2fr 1fr 1fr 1fr;
}

.port-detail-stats span,
.port-detail-grid div {
  background: #f8fafc;
  border: 1px solid var(--port-line);
  border-radius: 10px;
  color: var(--port-muted);
  display: block;
  font-size: 12px;
  padding: 10px 12px;
}

.port-detail-stats strong,
.port-detail-grid strong {
  color: var(--port-text);
  display: block;
  font-size: 16px;
  line-height: 1.25;
  margin-top: 2px;
}

.btn {
  border-radius: 8px;
  font-weight: 600;
}

.form-control,
.form-select,
.input-group-text {
  border-color: var(--port-line);
  border-radius: 8px;
}

@media (max-width: 992px) {
  #sidebar-wrapper {
    position: fixed;
    z-index: 1040;
  }

  body:not(.sb-sidenav-toggled) #sidebar-wrapper {
    margin-left: -276px;
  }

  body.sb-sidenav-toggled #sidebar-wrapper {
    flex-basis: 276px;
    width: 276px;
  }

  body.sb-sidenav-toggled #sidebar-wrapper .nav-label,
  body.sb-sidenav-toggled #sidebar-wrapper .port-sidebar-brand,
  body.sb-sidenav-toggled #sidebar-wrapper .group-chevron {
    display: inline-flex;
  }

  body.sb-sidenav-toggled #sidebar-wrapper .sidebar-nav-group-toggle,
  body.sb-sidenav-toggled #sidebar-wrapper .port-nav-link {
    justify-content: flex-start;
  }

  .port-admin-summary-grid,
  .port-filter-bar,
  .port-filter-bar-wide,
  .port-detail-stats,
  .port-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .port-page-shell {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .port-page-header {
    padding: 14px;
  }
}
/* UX04 - Dashboard, Pedidos, Ocorrencias e Compras */
.ux04-eyebrow {
  color: #60a5fa;
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ux04-kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ux04-kpi {
  background: #fff;
  border: 1px solid var(--port-line);
  border-radius: 8px;
  color: var(--port-text);
  min-height: 88px;
  padding: 12px 13px;
  position: relative;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.ux04-kpi:hover {
  border-color: #93c5fd;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
  color: var(--port-text);
  transform: translateY(-2px);
}

.ux04-kpi span {
  color: var(--port-muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ux04-kpi strong {
  display: block;
  font-size: 25px;
  line-height: 1;
  margin-top: 8px;
}

.ux04-kpi i {
  bottom: 10px;
  color: #cbd5e1;
  font-size: 20px;
  position: absolute;
  right: 14px;
}

.ux04-kpi--success { border-top: 4px solid #16a34a; }
.ux04-kpi--warning { border-top: 4px solid #f59e0b; }
.ux04-kpi--attention { border-top: 4px solid #ea580c; }
.ux04-kpi--info { border-top: 4px solid #2563eb; }
.ux04-kpi--neutral { border-top: 4px solid #0f766e; }
.ux04-kpi--muted { border-top: 4px solid #64748b; }

.ux04-dashboard-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ux04-panel {
  background: #fff;
  border: 1px solid var(--port-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
  min-width: 0;
  overflow: hidden;
}

.ux04-panel header {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid var(--port-line);
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.ux04-panel header span {
  color: #0f172a;
  font-weight: 800;
}

.ux04-panel header a {
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.ux04-list-item,
.ux04-rank-row {
  border-bottom: 1px solid #eef2f7;
  color: var(--port-text);
  display: block;
  padding: 9px 12px;
  text-decoration: none;
}

.ux04-list-item:hover {
  background: #f8fbff;
  color: var(--port-text);
}

.ux04-list-item strong,
.ux04-list-item span,
.ux04-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ux04-list-item span,
.ux04-list-item small {
  color: var(--port-muted);
}

.ux04-rank-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ux04-rank-row strong {
  background: #e0f2fe;
  border-radius: 999px;
  color: #075985;
  min-width: 54px;
  padding: 4px 9px;
  text-align: center;
}

.ux04-empty {
  color: var(--port-muted);
  padding: 18px 14px;
}

.ux04-section-title {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 4px 0 14px;
}

.ux04-section-title h3 {
  font-size: 22px;
  letter-spacing: 0;
  margin: 3px 0 0;
}

.ux04-section-title p {
  color: var(--port-muted);
  margin: 0;
  max-width: 640px;
}

.ux04-table-card,
.ux04-filter-card,
.ux04-page .card.shadow,
.ux04-page .card.shadow-sm {
  border: 1px solid var(--port-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .07) !important;
  overflow: hidden;
}

.ux04-table-card > .card-header,
.ux04-filter-card > .card-body,
.ux04-page .card-header {
  background: #f8fafc;
  border-color: var(--port-line);
}

.ux04-page .table {
  --bs-table-hover-bg: #f8fbff;
}

.ux04-page .table thead th,
.ux04-table-card .table thead th {
  background: #eef4fb;
  border-bottom: 1px solid #dbe4ef;
  color: #172033;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.ux04-page .table tbody td {
  border-color: #edf2f7;
}

.ux04-page .dataTables_wrapper .dataTables_filter input,
.ux04-page .dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  border: 1px solid var(--port-line);
  min-height: 36px;
}

.ux04-page .badge,
.ux04-page .status-badge,
.ux04-page .status-chip {
  border-radius: 999px;
  font-weight: 700;
}

.ux04-occ-kpis .kpi-card,
.compras-status-row .kpi-card {
  border: 1px solid var(--port-line);
  border-left: 4px solid #60a5fa;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06) !important;
  transition: transform .16s ease, box-shadow .16s ease;
}

.ux04-occ-kpis .kpi-card:hover,
.compras-status-row .kpi-card:hover {
  box-shadow: 0 16px 34px rgba(15, 23, 42, .10) !important;
  transform: translateY(-2px);
}

.compras-toolbar-card .compras-filters-row {
  align-items: end;
  gap: 10px;
}

.compras-toolbar-card label {
  color: var(--port-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-content {
  border: 1px solid var(--port-line);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}

.modal-header {
  background: #f8fafc;
  border-bottom-color: var(--port-line);
}

.modal-title {
  font-weight: 800;
  letter-spacing: 0;
}

.nav-tabs .nav-link {
  border-radius: 8px 8px 0 0;
  font-weight: 700;
}

@media (max-width: 1400px) {
  .ux04-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ux04-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ux04-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .ux04-kpi-grid,
  .ux04-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .ux04-page .table-responsive {
    border: 1px solid var(--port-line);
    border-radius: 10px;
  }

  .modal-dialog.modal-xl {
    margin: .5rem;
    max-width: calc(100% - 1rem);
  }
}

/* UX04 final - densidade, navegacao contextual e tabelas largas */
.ux04-filter-context {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  color: #0f172a;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.ux04-filter-context__label,
.ux04-filter-context small {
  color: #475569;
  display: block;
  font-size: 12px;
}

.ux04-filter-context strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.ux04-filter-context__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ux04-table-card .card-body,
.ux04-page .card-body {
  padding: 12px;
}

.ux04-table-card .table-responsive,
.port-main-card .table-responsive,
.port-data-card .table-responsive,
.port-atrasos-page .table-responsive,
.compras-page .table-responsive,
.ux04-page .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

#tabelaPedidos,
#tabelaCompras,
#tabelaAtrasos {
  min-width: 1320px;
}

#tabelaPedidos th:last-child,
#tabelaPedidos td:last-child,
#tabelaCompras th:last-child,
#tabelaCompras td:last-child,
#tabelaAtrasos th:last-child,
#tabelaAtrasos td:last-child {
  background: #fff;
  box-shadow: -8px 0 14px rgba(15, 23, 42, .06);
  min-width: 112px;
  position: sticky;
  right: 0;
  z-index: 3;
}

#tabelaPedidos thead th:last-child,
#tabelaCompras thead th:last-child,
#tabelaAtrasos thead th:last-child {
  background: #eef4fb;
  z-index: 5;
}

#tabelaPedidos th:first-child,
#tabelaPedidos td:first-child {
  background: #fff;
  left: 0;
  position: sticky;
  z-index: 4;
}

#tabelaPedidos thead th:first-child {
  background: #eef4fb;
  z-index: 6;
}

.port-detail-panel .table th,
.port-detail-panel .table td {
  white-space: nowrap;
}

.port-detail-panel .table td:first-child,
.port-detail-panel .table td:nth-child(3) {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.port-atrasos-page .port-dash-rank-card {
  border-radius: 8px;
}

.port-atrasos-page .port-atrasos-kpis {
  gap: 8px;
}

.port-atrasos-page .port-atrasos-kpi {
  min-height: 64px;
  padding: 9px 10px;
}

.ux04-page .btn,
.port-atrasos-page .btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .ux04-filter-context {
    align-items: stretch;
    flex-direction: column;
  }

  .ux04-filter-context__actions {
    justify-content: flex-start;
  }
}

/* RN19 - Administracao de acessos */
.rn19-access-page .rn19-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rn19-summary-card,
.rn19-card {
  background: #fff;
  border: 1px solid var(--port-line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.rn19-summary-card {
  min-height: 78px;
  padding: 12px 14px;
}

.rn19-summary-card span {
  color: var(--port-muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.rn19-summary-card strong {
  color: #0f172a;
  display: block;
  font-size: 26px;
  line-height: 1;
  margin-top: 8px;
}

.rn19-tabs .nav-link {
  color: #475569;
  font-weight: 800;
}

.rn19-tabs .nav-link.active {
  color: #1d4ed8;
}

.rn19-card .card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--port-line);
}

.rn19-access-page .table thead th {
  background: #eef4fb;
  color: #172033;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.rn19-access-page .table td {
  border-color: #edf2f7;
}

.rn19-search-small {
  max-width: 280px;
}

.rn19-permission-groups {
  display: grid;
  gap: 10px;
}

.rn19-perm-group {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

.rn19-perm-group h6 {
  color: #0f172a;
  font-weight: 800;
  margin-bottom: 8px;
}

.rn19-perm-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rn19-perm-check {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 8px;
}

.rn19-perm-check input {
  margin-top: 2px;
}

.rn19-perm-check span,
.rn19-perm-check small {
  display: block;
  min-width: 0;
}

.rn19-perm-check small {
  color: var(--port-muted);
  font-size: 11px;
}

.rn19-scope-editor textarea {
  font-size: 13px;
  resize: vertical;
}

.rn19-help,
.rn19-legend {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.rn19-help span,
.rn19-legend span {
  color: #475569;
  font-size: 13px;
}

#tabelaUsuarios {
  min-width: 1180px;
}

#tabelaUsuarios th:last-child,
#tabelaUsuarios td:last-child {
  background: #fff;
  box-shadow: -8px 0 14px rgba(15, 23, 42, .06);
  position: sticky;
  right: 0;
  z-index: 3;
}

#tabelaUsuarios thead th:last-child {
  background: #eef4fb;
  z-index: 5;
}

@media (max-width: 1200px) {
  .rn19-access-page .rn19-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rn19-perm-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .rn19-access-page .rn19-summary-grid {
    grid-template-columns: 1fr;
  }

  .rn19-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }
}
