:root {
    --azul-900: #064b86;
    --azul-800: #075b9f;
    --azul-700: #0870bd;
    --azul-050: #eef7ff;
    --vermelho: #d71920;
    --vermelho-escuro: #b9151b;
    --vermelho-050: #fff1f2;
    --verde-700: #16764b;
    --verde-050: #edf8f3;
    --branco: #ffffff;
    --fundo: #f3f6f9;
    --texto: #172033;
    --muted: #637083;
    --linha: #d8e1ec;
    --sombra: 0 18px 45px rgba(17, 32, 54, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--fundo);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--texto);
}

.topo {
    background: linear-gradient(135deg, var(--azul-900), var(--azul-700));
    color: var(--branco);
}

.topo-conteudo {
    width: min(1120px, calc(100% - 40px));
    min-height: 230px;
    margin: 0 auto;
    padding: 28px 0 52px;
    display: grid;
    grid-template-columns: 1fr 315px;
    gap: 32px;
    align-items: center;
}

.marca {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.marca-logo {
    width: 72px;
    min-width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--branco);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.marca-logo img {
    max-width: 64px;
    max-height: 64px;
    display: block;
}

.marca strong,
.marca small {
    display: block;
}

.marca strong {
    font-size: 19px;
    line-height: 1.05;
}

.marca small {
    margin-top: 3px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.86);
}

.topo h1 {
    margin: 0;
    color: var(--branco);
    font-size: clamp(31px, 4vw, 46px);
    line-height: 1.04;
    letter-spacing: 0;
}

.topo > .logo {
    max-width: 230px;
    max-height: 95px;
    margin: 24px auto 10px;
    display: block;
}

.topo > .subtitulo {
    padding-bottom: 24px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 15px;
}

.hero p {
    max-width: 650px;
    margin: 15px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 17px;
    line-height: 1.55;
}

.painel-seguranca {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.12);
}

.icone-seguranca {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
}

.painel-seguranca strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.painel-seguranca p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.45;
}

.pagina {
    width: min(1120px, calc(100% - 40px));
    margin: -34px auto 48px;
}

.container {
    width: min(900px, calc(100% - 40px));
    margin: 30px auto;
    padding: 30px;
    border: 1px solid rgba(216, 225, 236, 0.9);
    border-radius: 8px;
    background: var(--branco);
    box-shadow: var(--sombra);
}

.layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.menu-manifestacao,
.cartao-formulario,
.protocolo {
    border: 1px solid rgba(216, 225, 236, 0.9);
    border-radius: 8px;
    background: var(--branco);
    box-shadow: var(--sombra);
}

.menu-manifestacao,
.cartao-formulario {
    padding: 24px;
}

.menu-titulo {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.opcao {
    width: 100%;
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--linha);
    border-radius: 8px;
    background: var(--branco);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.opcao:hover,
.opcao:focus-visible {
    border-color: rgba(8, 112, 189, 0.42);
    box-shadow: 0 8px 18px rgba(17, 32, 54, 0.08);
    transform: translateY(-1px);
}

.opcao:focus-visible {
    outline: 3px solid rgba(8, 112, 189, 0.18);
    outline-offset: 2px;
}

.opcao.ativa {
    border-color: rgba(215, 25, 32, 0.38);
    background: var(--vermelho-050);
}

.opcao-icone {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--azul-050);
    color: var(--azul-800);
}

.opcao.ativa .opcao-icone {
    background: var(--branco);
    color: var(--vermelho);
}

.opcao strong,
.opcao span {
    display: block;
}

.opcao strong {
    font-size: 14px;
}

.opcao span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.protocolo {
    margin-bottom: 22px;
    padding: 24px;
    text-align: center;
}

.protocolo h2 {
    margin: 0 0 8px;
    color: var(--azul-900);
}

.protocolo p {
    margin: 0;
    color: var(--muted);
}

.numero-protocolo {
    display: inline-block;
    margin: 16px 0;
    padding: 14px 22px;
    border-radius: 8px;
    background: var(--azul-900);
    color: var(--branco);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}

.link-acompanhar {
    color: var(--vermelho);
    font-weight: 800;
    text-decoration: none;
}

.alerta {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    margin-bottom: 24px;
    padding: 15px;
    border: 1px solid #b8dccb;
    border-left: 5px solid var(--verde-700);
    border-radius: 8px;
    background: var(--verde-050);
}

.alerta-icone {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--branco);
    color: var(--verde-700);
}

.alerta strong {
    display: block;
    margin-bottom: 3px;
    font-size: 15px;
}

.alerta p {
    margin: 0;
    color: #31513f;
    font-size: 13px;
    line-height: 1.45;
}

.container .alerta {
    display: block;
    border-color: #f1d18a;
    border-left-color: var(--vermelho);
    background: #fff8e1;
    color: #4d4634;
}

.container form > label {
    display: block;
    margin-top: 18px;
    margin-bottom: 6px;
}

.container form > .botao {
    width: 100%;
    margin-top: 30px;
}

.secao-titulo {
    margin: 24px 0 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--linha);
    color: var(--azul-900);
    font-size: 15px;
}

.secao-titulo:first-of-type {
    margin-top: 0;
}

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

.campo {
    display: grid;
    gap: 7px;
}

.campo-largo {
    grid-column: 1 / -1;
}

label,
legend {
    color: #073b6d;
    font-size: 13px;
    font-weight: 800;
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.grupo-identificacao {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 5px;
    border: 1px solid #cbd7e4;
    border-radius: 8px;
    background: #f6f9fc;
}

.grupo-identificacao legend {
    grid-column: 1 / -1;
    margin: 0 0 2px;
}

.segmento {
    min-height: 38px;
    cursor: pointer;
}

.segmento input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmento span {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.segmento input:checked + span {
    background: var(--branco);
    color: var(--azul-900);
    box-shadow: 0 2px 8px rgba(17, 32, 54, 0.12);
}

.obrigatorio {
    color: var(--vermelho);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd7e4;
    border-radius: 8px;
    background: var(--branco);
    color: var(--texto);
    font: inherit;
    font-size: 14px;
    outline: 0;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input,
select {
    min-height: 44px;
    padding: 0 12px;
}

input[type="file"] {
    padding: 10px 12px;
}

textarea {
    min-height: 138px;
    padding: 12px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--azul-700);
    box-shadow: 0 0 0 3px rgba(8, 112, 189, 0.14);
}

.ajuda,
.microcopy {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.acoes-formulario {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.botao {
    min-height: 48px;
    flex: 1;
    border: 0;
    border-radius: 8px;
    background: var(--vermelho);
    color: var(--branco);
    font: inherit;
    font-weight: 900;
    padding: 0 26px;
    cursor: pointer;
    box-shadow: 0 12px 20px rgba(215, 25, 32, 0.18);
    transition: background 0.18s ease, transform 0.18s ease;
}

.botao:hover {
    background: var(--vermelho-escuro);
    transform: translateY(-1px);
}

.botao-secundario {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd7e4;
    border-radius: 8px;
    background: var(--branco);
    color: #073b6d;
    font: inherit;
    font-weight: 800;
    padding: 0 18px;
    cursor: pointer;
    text-decoration: none;
}

.botao-secundario.bloco {
    width: 100%;
    margin-top: 18px;
    border-color: var(--azul-700);
    color: var(--azul-800);
}

.microcopy {
    margin-top: 14px;
    text-align: center;
}

.erro {
    background: #ffe5e5;
    border-left: 5px solid var(--vermelho);
    padding: 15px;
    border-radius: 8px;
    color: #7a0000;
    margin-bottom: 20px;
}

.card-status {
    background: #f8fbff;
    border: 1px solid #d6e8f8;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.status-badge {
    display: inline-block;
    background: var(--azul-700);
    color: var(--branco);
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: bold;
}

.tabela {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.tabela th,
.tabela td {
    border-bottom: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.tabela th {
    background: var(--azul-900);
    color: var(--branco);
}

.acoes a {
    color: var(--vermelho);
    font-weight: bold;
    text-decoration: none;
}

.admin {
    background: #f4f6f9;
}

.topo-admin {
    background: var(--branco);
    border-bottom: 1px solid var(--linha);
}

.topo-admin-conteudo {
    width: min(1180px, calc(100% - 40px));
    min-height: 86px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.admin-marca {
    margin: 0;
    color: var(--texto);
}

.admin-marca .marca-logo {
    width: 58px;
    min-width: 58px;
    height: 58px;
    border: 1px solid var(--linha);
    box-shadow: none;
}

.admin-marca .marca-logo img {
    max-width: 52px;
    max-height: 52px;
}

.admin-marca small {
    color: var(--muted);
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--linha);
    border-radius: 8px;
    background: var(--branco);
    color: var(--azul-900);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.admin-pagina {
    width: min(1180px, calc(100% - 40px));
    margin: 28px auto 48px;
}

.admin-cabecalho,
.detalhe-topo {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--vermelho);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-cabecalho h1,
.detalhe-topo h1 {
    margin: 0;
    color: var(--azul-900);
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: 0;
}

.admin-cabecalho p,
.detalhe-topo p,
.admin-card-topo p,
.texto-apoio {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.metricas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metrica,
.admin-card {
    border: 1px solid rgba(216, 225, 236, 0.9);
    border-radius: 8px;
    background: var(--branco);
    box-shadow: 0 10px 28px rgba(17, 32, 54, 0.08);
}

.metrica {
    padding: 18px;
}

.metrica span,
.dados-grid dt {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metrica strong {
    display: block;
    margin-top: 8px;
    color: var(--azul-900);
    font-size: 31px;
    line-height: 1;
}

.admin-card {
    padding: 22px;
}

.admin-card-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-card h2 {
    margin: 0;
    color: var(--azul-900);
    font-size: 19px;
}

.tabela-responsiva {
    overflow-x: auto;
}

.admin-tabela {
    margin-top: 0;
    min-width: 760px;
}

.admin-tabela th {
    background: #f8fbff;
    color: #073b6d;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-tabela td {
    color: #273244;
    vertical-align: middle;
}

.protocolo-tabela {
    color: var(--azul-900);
    font-size: 13px;
}

.acao-abrir {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 7px;
    background: var(--azul-050);
    color: var(--azul-900) !important;
}

.estado-vazio {
    padding: 28px !important;
    color: var(--muted);
    text-align: center !important;
}

.status-badge {
    background: #edf4ff;
    color: var(--azul-900);
}

.status-recebida {
    background: #eef7ff;
    color: var(--azul-900);
}

.status-em-analise,
.status-em-investigacao {
    background: #fff6df;
    color: #8a5a00;
}

.status-concluida {
    background: var(--verde-050);
    color: var(--verde-700);
}

.status-arquivada {
    background: #eef0f3;
    color: #4b5563;
}

.status-grande {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.detalhe-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

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

.dados-grid div {
    padding: 14px;
    border: 1px solid var(--linha);
    border-radius: 8px;
    background: #fbfdff;
}

.dados-grid dd {
    margin: 6px 0 0;
    color: var(--texto);
    font-weight: 800;
    word-break: break-word;
}

.bloco-relato {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--linha);
    border-radius: 8px;
    background: #fbfdff;
}

.bloco-relato h3 {
    margin: 0 0 10px;
    color: var(--azul-900);
    font-size: 16px;
}

.bloco-relato p {
    margin: 0;
    color: #273244;
    line-height: 1.6;
    white-space: pre-wrap;
}

.anexo-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed #aebed0;
    border-radius: 8px;
    background: #fbfdff;
}

.anexo-card strong,
.anexo-card span {
    display: block;
}

.anexo-card span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    word-break: break-all;
}

.painel-tratativa {
    position: sticky;
    top: 18px;
}

.painel-tratativa form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.painel-tratativa textarea {
    min-height: 190px;
}

.compacto {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
}

.atalhos {
    margin-top: 22px;
    text-align: center;
}

.atalhos a {
    color: var(--azul-900);
    font-weight: 800;
    text-decoration: none;
}

.rodape {
    margin-top: 30px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 900px) {
    .topo-conteudo {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .menu-manifestacao {
        order: 2;
    }

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

    .detalhe-layout {
        grid-template-columns: 1fr;
    }

    .painel-tratativa {
        position: static;
    }
}

@media (max-width: 620px) {
    .topo-conteudo,
    .pagina {
        width: min(100% - 24px, 1120px);
    }

    .topo-conteudo {
        padding: 20px 0 44px;
    }

    .marca {
        margin-bottom: 20px;
    }

    .marca-logo {
        width: 62px;
        min-width: 62px;
        height: 62px;
    }

    .marca-logo img {
        max-width: 56px;
        max-height: 56px;
    }

    .menu-manifestacao,
    .cartao-formulario,
    .protocolo {
        padding: 16px;
    }

    .grade,
    .grupo-identificacao {
        grid-template-columns: 1fr;
    }

    .acoes-formulario {
        display: grid;
    }

    .botao,
    .botao-secundario {
        width: 100%;
    }

    .numero-protocolo {
        font-size: 19px;
    }

    .topo-admin-conteudo,
    .admin-cabecalho,
    .detalhe-topo,
    .admin-card-topo,
    .anexo-card {
        display: grid;
    }

    .admin-nav {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .metricas,
    .dados-grid {
        grid-template-columns: 1fr;
    }
}
