:root {
    --bg-dark: #0f1117;
    --card-bg: #181b24;
    --border-color: #262a36;
    --text-main: #f1f5f9;
    --text-muted: #8b949e;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, #172554, #020617 58%);
}

.auth-page[hidden], #app-workspace[hidden] { display: none; }

.auth-card {
    width: min(100%, 420px);
    display: grid;
    gap: 12px;
    padding: 32px;
    border: 1px solid #334155;
    border-radius: 16px;
    background: #0f172a;
    box-shadow: 0 24px 70px rgb(0 0 0 / 35%);
}

.auth-login-layout {
    width: min(100%, 420px);
    display: grid;
    justify-items: center;
    gap: 24px;
}

.auth-login-logo {
    display: block;
    width: min(68%, 250px);
    height: auto;
}

.auth-login-card { width: 100%; }
.auth-login-heading { display: grid; gap: 6px; text-align: center; margin-bottom: 8px; }
.auth-login-heading h1 { font-size: clamp(1.6rem, 5vw, 2rem); line-height: 1.15; }
.auth-login-heading p { color: #cbd5e1; line-height: 1.45; }

.auth-password-field { position: relative; }
.auth-password-field input { padding-right: 46px; }
.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}
.auth-password-toggle:hover { color: #f8fafc; background: rgb(148 163 184 / 12%); }
.auth-password-toggle:focus-visible { outline: 3px solid rgb(59 130 246 / 45%); outline-offset: 1px; }

.auth-card h1, .auth-card p { margin: 0; }
.auth-card label { margin-top: 6px; font-weight: 600; }
.auth-card input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #020617;
    color: #f8fafc;
}
.auth-card input:focus { outline: 3px solid rgb(59 130 246 / 35%); border-color: #60a5fa; }
.auth-brand { font-size: 1.15rem; font-weight: 700; color: #f8fafc; }
.auth-brand span { color: #60a5fa; }
.auth-message { min-height: 1.25rem; color: #fca5a5; }
.auth-requirements { margin: 4px 0; padding-left: 20px; color: #cbd5e1; font-size: .88rem; }
.auth-actions { display: flex; gap: 10px; }

@media (max-width: 480px) {
    .auth-page { padding: 18px; align-items: start; }
    .auth-login-layout { gap: 18px; margin-block: auto; }
    .auth-card { padding: 24px 20px; }
    .auth-login-logo { width: min(72%, 220px); }
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Aplica a fonte Inter no body e inputs, permitindo que FontAwesome continue funcionando nos <i> */
body, input, button, select, textarea {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 24px;
    font-size: 14px;
}

.btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-direction:column;
    transition: all 0.2s;
}

.btn:hover {
    border-color: var(--accent-blue);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Top KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
}

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

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

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

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

.kpi-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    min-height: 0;
    flex-direction: column;
    padding: 11px 12px;
    position: relative;
    min-width: 0;
}

.kpi-title {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    margin: 5px 0 3px;
}

.kpi-subtext {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Main Dashboard Content Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
   
}

.panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
}

.panel-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Badge/Tags */
.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}
.badge-green { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-yellow { background: rgba(234, 179, 8, 0.15); color: var(--accent-yellow); }

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}

th {
    background-color: #13151d;
    color: var(--text-muted);
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background-color: #1e222e;
}

/* Garante preenchimento total da tela mantendo o espaçamento externo (padding) */
body {
    margin: 0;
    padding: 10px;
    width: 100%;
    overflow-x: hidden;
}

/* Garante que os painéis ocupem a largura do container */
.panel {
    width: 100%;
    box-sizing: border-box;
}

.populacao-eyebrow {
    color: #60a5fa;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.aviso-comparabilidade {
    margin: 0 0 18px;
    padding: 10px 14px;
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.06);
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.evolucao-resumo {
    display: grid;
    grid-template-columns: repeat(3, minmax(145px, 1fr));
    gap: 12px;
    margin: 0 10px 14px;
}

.delivery-kpi {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 112px;
    padding: 14px 15px;
    border: 1px solid var(--border-color);
    border-top: 3px solid #64748b;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.48));
}

.delivery-kpi span {
    color: var(--text-muted);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.delivery-kpi strong {
    color: var(--text-main);
    font-size: 1.5rem;
    line-height: 1.1;
}

.delivery-kpi small {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.delivery-kpi-volume {
    border-top-color: #60a5fa;
}

.delivery-kpi-ftr {
    border-top-color: #10b981;
}

.delivery-kpi-prazo {
    border-top-color: #38bdf8;
}

.delivery-kpi-anomalias {
    border-top-color: #f59e0b;
}

.delivery-kpi-retrabalho {
    border-top-color: #a78bfa;
}

.delivery-kpi-sem-prazo {
    border-top-color: #94a3b8;
}

.evolucao-estado {
    margin: 0 10px 8px;
    padding: 9px 12px;
    border: 1px dashed var(--border-color);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-align: center;
}

.deliveries-evolution-flow {
    min-width: 0;
}

.kpi-card:hover,
.kpi-card:focus-within,
.delivery-kpi:hover,
.delivery-kpi:focus-within {
    z-index: 20;
}

.delivery-kpi {
    position: relative;
}

.kpi-help-region {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 30;
    display: inline-flex;
}

.kpi-help-region--inline {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
}

.kpi-help-button {
    position: static;
    display: inline-grid;
    width: 30px;
    height: 30px;
    cursor: pointer;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
}

.kpi-help-button:hover,
.kpi-help-button:focus-visible,
.kpi-help-button[aria-expanded="true"] {
    border-color: rgb(96 165 250 / 45%);
    background: rgb(59 130 246 / 14%);
    color: #93c5fd;
    outline: none;
}

.kpi-help-button:focus-visible {
    box-shadow: 0 0 0 3px rgb(96 165 250 / 32%);
}

.panel-title-with-help {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.kpi-help-button.kpi-help-button--inline {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.panel[data-kpi-help] {
    position: relative;
}

.kpi-card[data-kpi-help] .kpi-title,
.kpi-card[data-kpi-help] > .kpi-subtext:first-child,
.delivery-kpi[data-kpi-help] > span:first-child {
    padding-right: 32px;
}

.contextual-help-layer {
    position: fixed;
    z-index: 90;
    inset: 0;
    pointer-events: none;
}

.kpi-help-popover {
    position: fixed;
    width: min(340px, calc(100vw - 40px));
    max-height: min(480px, 72vh);
    padding: 15px;
    overflow: auto;
    border: 1px solid #3b455a;
    border-radius: 10px;
    background: #111827;
    box-shadow: 0 18px 42px rgb(0 0 0 / 42%);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.45;
    text-align: left;
    text-transform: none;
    pointer-events: auto;
}

.kpi-help-title {
    display: block;
    margin-bottom: 10px;
    color: #bfdbfe;
    font-size: 0.86rem;
}

.kpi-help-popover dl {
    display: grid;
    gap: 4px;
    margin: 0;
}

.kpi-help-popover dt {
    margin-top: 7px;
    color: #93c5fd;
    font-weight: 700;
}

.kpi-help-paragraphs {
    display: grid;
    gap: 8px;
}

.kpi-help-paragraphs p {
    margin: 0;
}

.kpi-help-popover dd {
    margin: 0;
    color: #cbd5e1;
}

.deliveries-chart-container {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 280px;
    margin: 0 0 18px;
    padding: 10px;
    overflow: hidden;
}

.evolucao-tabela-container {
    position: relative;
    isolation: isolate;
    max-height: 240px;
    margin-top: 0;
    overflow: auto;
    padding: 0 10px 10px;
}

.evolucao-tabela {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    font-size: 0.78rem;
    text-align: right;
}

.evolucao-tabela thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #1e293b;
}

.evolucao-tabela th,
.evolucao-tabela td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border-color);
}

.evolucao-tabela th:first-child,
.evolucao-tabela .evolucao-periodo {
    text-align: left;
}

@media (max-width: 640px) {
    .evolucao-resumo {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 641px) and (max-width: 960px) {
    .evolucao-resumo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* UX-ACESSO-B.1 — shell persistente e navegação por hash */
[hidden] {
    display: none !important;
}

body {
    padding: 0;
}

/* #app-shell {
    min-height: 100vh;
    background: var(--bg-dark);
} */

#app-workspace {
    width: 100%;
    min-width: 0;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.app-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.app-brand-copy strong {
    font-size: 0.95rem;
}

.app-brand-copy small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-nav-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #a8b0bf;
    text-decoration: none;
    white-space: nowrap;
}

.app-nav-link i {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
}

.app-nav-link:hover {
    border-color: #293246;
    background: #191e29;
    color: #fff;
}

.app-nav-link.is-active {
    border-color: rgb(59 130 246 / 30%);
    background: rgb(37 99 235 / 16%);
    color: #93c5fd;
    box-shadow: inset 0 -3px #3b82f6;
}

#app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 76px;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgb(15 17 23 / 94%);
    backdrop-filter: blur(12px);
}

.app-page-heading h1 {
    margin: 0;
    font-size: 1.25rem;
}

.app-page-heading p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.76rem;
}

#app-content {
    min-width: 0;
    padding: 10px;
    outline: none;
}

.filter-panel {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #1e293b;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 10%);
}

.module-placeholder {
    max-width: 680px;
    margin: 8vh auto 0;
    padding: 42px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
    text-align: center;
}

.module-placeholder-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 14px;
    background: rgb(59 130 246 / 14%);
    color: #60a5fa;
    font-size: 1.25rem;
}

.module-placeholder-eyebrow {
    color: #60a5fa !important;
    font-size: 0.7rem !important;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.module-placeholder h2 {
    margin: 8px 0;
    font-size: 1.5rem;
}

.module-placeholder p {
    margin: 8px 0 20px;
    color: var(--text-muted);
    line-height: 1.55;
}

.module-placeholder strong {
    display: block;
    margin-top: 28px;
    font-size: 0.9rem;
}

.module-placeholder-action {
    width: fit-content;
    margin: 26px auto 0;
    text-decoration: none;
}

.btn:focus-visible,
.app-nav-link:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 2px;
}

@media (max-width: 720px) {
    #app-header {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px 14px;
        padding: 12px 14px;
    }

    .app-nav {
        grid-column: 1 / -1;
        width: 100%;
    }

    .app-nav-link {
        flex: 1;
        justify-content: center;
    }

    #app-content {
        padding: 14px;
    }

    .app-page-heading h1 {
        font-size: 1.05rem;
    }

    .app-page-heading p {
        display: none;
    }

    .module-placeholder {
        margin-top: 4vh;
        padding: 28px 20px;
    }
}

@media (max-width: 480px) {
    .app-brand-copy {
        display: none;
    }

    .app-page-heading p {
        display: none;
    }
}

/* UX-ACESSO-B.2 — contexto compartilhado e página Entregas */
.filter-context-bar {
    display: grid;
    gap: 14px;
}

.filter-context-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.filter-context-heading h2 {
    margin: 0;
    font-size: 0.95rem;
}

.filter-context-heading p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.filter-context-summary {
    max-width: 48%;
    text-align: right;
}

.filter-context-form {
    display: grid;
    grid-template-columns: minmax(135px, 1fr) minmax(135px, 1fr) minmax(180px, 1.35fr) minmax(200px, 1.5fr) auto;
    gap: 12px;
    align-items: end;
}

.filter-context-form label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.filter-context-form input,
.filter-context-form select {
    width: 100%;
    height: 40px;
    padding: 8px 10px;
    border: 1px solid #334155;
    border-radius: 7px;
    outline: none;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.82rem;
}

.filter-context-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-context-actions .btn {
    min-height: 40px;
    white-space: nowrap;
}

.filter-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.filter-context-error,
.filter-catalog-error {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgb(239 68 68 / 35%);
    border-radius: 7px;
    background: rgb(127 29 29 / 18%);
    color: #fecaca;
    font-size: 0.76rem;
}

.deliveries-page {
    display: grid;
    gap: 0;
}

#deliveries-module-content {
    min-width: 0;
}

#dashboard-page > #deliveries-module-content {
    display: none;
}

.deliveries-page #deliveries-module-content {
    width: 100%;
}

.deliveries-page .deliveries-chart-container #chartEvolucao {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    max-height: 100%;
}

.deliveries-deadline-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid rgb(245 158 11 / 30%);
    border-radius: 7px;
    background: rgb(120 53 15 / 14%);
    color: #fde68a;
    font-size: 0.76rem;
}

.deliveries-retry {
    width: fit-content;
    margin-top: 12px;
}

.route-page{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.deadline-distribution-panel {
    min-width: 0;
}

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

.dashboard-evolution-panel {
    min-width: 0;
}

.deadline-distribution-chart {
    position: relative;
    width: 100%;
    height: 410px;
    padding: 10px;
}

.task-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.task-local-filters {
    display: grid;
    gap: 12px;
    margin: 0 16px 14px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: rgb(15 23 42 / 45%);
}

.task-local-filters-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.task-local-filters-heading h3 {
    margin: 0;
    font-size: 0.82rem;
}

.task-local-filters-heading p,
.task-local-filters-heading span {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.task-local-filters-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.task-local-filters-clear {
    padding: 6px 10px;
    border: 1px solid #475569;
    border-radius: 7px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
}

.task-local-filters-clear:hover,
.task-local-filters-clear:focus-visible {
    border-color: #60a5fa;
    color: #f8fafc;
}

.task-local-filters-clear:focus-visible {
    outline: 3px solid rgb(96 165 250 / 22%);
    outline-offset: 2px;
}

.task-local-filters-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.task-local-filters-controls label {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.task-local-filters-controls input,
.task-local-filters-controls select {
    width: 100%;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid #334155;
    border-radius: 7px;
    outline: none;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.8rem;
}

.task-local-filters-controls input:focus-visible,
.task-local-filters-controls select:focus-visible {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgb(96 165 250 / 22%);
}

.task-title-button {
    padding: 2px 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #93c5fd;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
}

.task-title-button:hover {
    color: #bfdbfe;
    text-decoration-color: currentColor;
}

.task-title-button:focus-visible {
    outline: 3px solid rgb(96 165 250 / 28%);
    outline-offset: 2px;
}

body.task-detail-modal-open {
    overflow: hidden;
}

.task-detail-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    padding: 24px;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
}

.task-detail-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgb(2 6 23 / 78%);
    cursor: default;
}

.task-detail-dialog {
    position: relative;
    display: flex;
    width: min(1000px, calc(100vw - 48px));
    height: auto;
    margin: auto 0;
    flex-direction: column;
    border: 1px solid #334155;
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: 0 24px 70px rgb(0 0 0 / 48%);
}

.task-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.task-detail-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.task-detail-header h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
}

.task-detail-close {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #111827;
    color: #cbd5e1;
    cursor: pointer;
}

.task-detail-close:hover,
.task-detail-close:focus-visible {
    border-color: #60a5fa;
    color: #fff;
}

.task-detail-close:focus-visible {
    outline: 3px solid rgb(96 165 250 / 22%);
    outline-offset: 2px;
}

.task-detail-content {
    display: grid;
    gap: 12px;
    padding: 14px 20px;
}

.task-detail-status {
    margin: 0;
    padding: 9px 11px;
    border: 1px solid rgb(59 130 246 / 24%);
    border-radius: 8px;
    background: rgb(37 99 235 / 10%);
    color: #bfdbfe;
    font-size: 0.76rem;
}

.task-detail-status:empty {
    display: none;
}

.task-detail-status.is-error {
    border-color: rgb(239 68 68 / 28%);
    background: rgb(127 29 29 / 18%);
    color: #fecaca;
}

.task-detail-description-section,
.task-detail-participants-section,
.task-detail-tags-section {
    display: grid;
    gap: 6px;
}

.task-detail-description-section h3,
.task-detail-participants-section h3,
.task-detail-tags-section h3 {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.task-detail-description-section p {
    max-height: 180px;
    margin: 0;
    padding: 10px 12px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: rgb(15 23 42 / 55%);
    color: #d7dce5;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

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

.task-detail-grid > div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: rgb(15 23 42 / 38%);
}

.task-detail-grid dt {
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
}

.task-detail-grid dd {
    margin: 0;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.task-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.task-detail-observers {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: rgb(15 23 42 / 38%);
}

.task-detail-observers-list {
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.task-detail-tag {
    padding: 5px 8px;
    border: 1px solid rgb(139 92 246 / 28%);
    border-radius: 999px;
    background: rgb(124 58 237 / 12%);
    color: #ddd6fe;
    font-size: 0.72rem;
}

.task-detail-empty {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.task-detail-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px 14px;
    border-top: 1px solid var(--border-color);
}

.task-detail-bitrix-link {
    background: #2563eb;
    border-color: #3b82f6;
    color: #fff;
    text-decoration: none;
}

.task-detail-bitrix-link:hover {
    background: #1d4ed8;
}

@media (max-width: 640px) {
    .task-detail-modal {
        padding: 10px;
    }

    .task-detail-dialog {
        width: 100%;
    }

    .task-detail-header,
    .task-detail-content,
    .task-detail-footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .task-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .task-detail-footer {
        justify-content: stretch;
    }

    .task-detail-bitrix-link {
        width: 100%;
        justify-content: center;
    }
}

.dashboard-evolution-chart {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 410px;
    padding: 10px;
    overflow: hidden;
}

.dashboard-evolution-chart .evolution-series-canvas {
    position: relative;
    width: 100%;
    min-height: 0;
}

.dashboard-evolution-chart #chartEvolucaoDashboard {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.dashboard-evolucao-estado {
    margin: 12px;
}

@media (max-width: 900px) {
    .dashboard-overview-charts {
        grid-template-columns: minmax(0, 1fr);
    }
}

.export-status {
    max-width: 230px;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

/* UX-ACESSO-B.3-I — página Prazos Operacionais */
.deadlines-page {
    display: grid;
    gap: 18px;
}

.deadlines-page #deadlines-filter-context {
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #1e293b;
}

.deadlines-population {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
}

.deadlines-population h2 {
    margin: 6px 0;
    font-size: 1.15rem;
}

.deadlines-population > p:not(.populacao-eyebrow) {
    color: var(--text-muted);
    line-height: 1.5;
}

.deadlines-population dl {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 0;
}

.deadlines-population dl > div {
    min-width: 220px;
    padding: 11px 13px;
    border: 1px solid #2c3443;
    border-radius: 8px;
    background: #141923;
}

.deadlines-population dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.deadlines-population dd {
    margin: 5px 0 0;
    font-size: 0.8rem;
}

.deadlines-state {
    padding: 14px;
    border: 1px dashed var(--border-color);
    border-radius: 9px;
    color: var(--text-muted);
    text-align: center;
}

.deadlines-retry {
    width: fit-content;
    margin: 12px auto 0;
}

#deadlines-data {
    display: grid;
    gap: 18px;
}

.deadlines-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 12px;
}

.deadline-kpi {
    display: flex;
    min-width: 0;
    min-height: 116px;
    flex-direction: column;
    gap: 7px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-top: 3px solid #64748b;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.48));
}

.deadline-kpi span,
.deadline-category span {
    color: var(--text-muted);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.deadline-kpi strong {
    color: var(--text-main);
    font-size: 1.55rem;
    line-height: 1.1;
}

.deadline-kpi small {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.deadline-kpi-total {
    border-top-color: #60a5fa;
}

.deadline-kpi-completed,
.deadline-kpi-adherence {
    border-top-color: #34d399;
}

.deadline-kpi-open {
    border-top-color: #f59e0b;
}

.deadline-kpi-unmeasurable {
    border-top-color: #94a3b8;
}

.deadline-section {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--card-bg);
}

.deadline-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.deadline-section-heading h3 {
    margin: 5px 0 0;
    font-size: 0.95rem;
}

.deadline-section-heading > p {
    max-width: 340px;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    text-align: right;
}

.deadline-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    gap: 12px;
}

.deadline-category-grid-backlog {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
}

.deadline-category {
    display: flex;
    min-width: 0;
    min-height: 92px;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid #2c3443;
    border-left: 4px solid #64748b;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.55);
}

.deadline-category strong {
    color: var(--text-main);
    font-size: 1.45rem;
}

.deadline-category.is-positive {
    border-left-color: #34d399;
}

.deadline-category.is-critical {
    border-left-color: #f87171;
}

.deadline-category.is-muted {
    border-left-color: #94a3b8;
}

.deadlines-reconciliation {
    margin: 0;
    padding: 11px 14px;
    border: 1px solid rgb(96 165 250 / 30%);
    border-radius: 8px;
    background: rgb(59 130 246 / 8%);
    color: #bfdbfe;
    font-size: 0.76rem;
    line-height: 1.45;
}

@media (max-width: 1180px) {
    .filter-context-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-context-actions {
        grid-column: 1 / -1;
    }

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

@media (max-width: 640px) {
    .filter-context-heading {
        flex-direction: column;
        gap: 4px;
    }

    .filter-context-summary {
        max-width: none;
        text-align: left;
    }

    .filter-context-form {
        grid-template-columns: 1fr;
    }

    .filter-context-actions {
        grid-column: auto;
        flex-wrap: wrap;
    }

    .filter-context-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .evolucao-resumo {
        grid-template-columns: 1fr;
    }

    .deadline-distribution-chart {
        height: 480px;
        padding-inline: 0;
    }

    .deadlines-population dl {
        display: grid;
    }

    .deadlines-population dl > div {
        min-width: 0;
    }

    .deadline-section-heading {
        flex-direction: column;
        gap: 8px;
    }

    .deadline-section-heading > p {
        max-width: none;
        text-align: left;
    }

    .deadline-category-grid,
    .deadline-category-grid-backlog {
        grid-template-columns: 1fr;
    }
}

/* Passo 2.7-B — distribuição de complexidade e carga */
.complexidade-panel {
    flex: 0 0 100%;
}

.complexidade-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.complexidade-badge {
    border: 1px solid;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.complexidade-badge.is-attention {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
}

.complexidade-badge.is-ok {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.45);
}

.complexidade-estado,
.complexidade-alerta {
    padding: 14px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    text-align: center;
}

.complexidade-alerta {
    margin-bottom: 18px;
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}

.complexidade-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.complexidade-resumo-item,
.complexidade-nivel,
.complexidade-qualidade-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.45);
}

.complexidade-resumo-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 74px;
    padding: 12px;
}

.complexidade-resumo-item span,
.complexidade-resumo-item small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.complexidade-resumo-item strong {
    color: var(--text-main);
    font-size: 1.12rem;
}

.complexidade-secao-titulo {
    margin: 18px 0 10px;
    color: var(--text-main);
    font-size: 0.83rem;
    font-weight: 700;
}

.complexidade-niveis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.complexidade-nivel {
    padding: 14px;
}

.complexidade-nivel h4 {
    margin: 0 0 8px;
    color: var(--text-main);
    font-size: 0.85rem;
}

.complexidade-nivel-valor {
    margin-bottom: 10px;
    color: #60a5fa;
    font-size: 1.2rem;
    font-weight: 700;
}

.complexidade-barra {
    height: 7px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #1e293b;
}

.complexidade-barra span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.complexidade-nivel p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.complexidade-qualidade {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.complexidade-qualidade-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px;
}

.complexidade-qualidade-item strong {
    font-size: 1rem;
}

.complexidade-qualidade-item span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.complexidade-qualidade-item.is-attention strong {
    color: #fbbf24;
}

.complexidade-qualidade-item.is-muted strong {
    color: #64748b;
}

@media (max-width: 640px) {
    .task-local-filters-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-local-filters-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .task-local-filters-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-context-actions .export-status {
        flex: 1 0 100%;
        max-width: none;
    }

    .complexidade-header {
        align-items: stretch;
        flex-direction: column;
    }

    .complexidade-badge {
        align-self: flex-start;
    }

    .complexidade-niveis {
        grid-template-columns: 1fr;
    }
}
