.sistema-pncd-painel {
    --pncd-teal: #0d9488;
    --pncd-teal-dark: #0f766e;
    --pncd-blue: #2563eb;
    --pncd-blue-dark: #1d4ed8;
    --pncd-surface: #f8fafc;
    --pncd-card: #ffffff;
    --pncd-border: #cbd5e1;
    --pncd-text: #0f172a;
    --pncd-muted: #64748b;
    --pncd-shadow: 0 10px 40px rgba(2, 8, 23, 0.35);
    --pncd-radius: 14px;

    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100dvh;
    max-height: 100dvh;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(13, 148, 136, 0.35), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(37, 99, 235, 0.28), transparent 50%),
        linear-gradient(165deg, #04102a 0%, #061a3f 45%, #0a2247 100%);
    color: var(--text, #eef4ff);
}

@supports (-webkit-touch-callout: none) {
    .sistema-pncd-painel {
        height: -webkit-fill-available;
        max-height: -webkit-fill-available;
    }
}

.sistema-pncd-painel .botao.compact,
.sistema-pncd-painel .botao.admin-small,
.sistema-pncd-painel label.botao.compact {
    min-width: 0;
    max-width: 100%;
    width: auto;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
}

.sistema-pncd-painel.oculta {
    display: none;
}

.sistema-pncd-topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    padding-top: max(14px, env(safe-area-inset-top));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(2, 8, 23, 0.55);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.sistema-pncd-topo h2 {
    margin: 0;
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.02em;
}

.sistema-pncd-topo h2 i {
    color: #5eead4;
}

.sistema-pncd-topo p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--muted, #9fb3d9);
}

.sistema-pncd-acoes-topo {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.sistema-pncd-acoes-topo .botao {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
    white-space: normal;
    justify-content: center;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sistema-pncd-corpo {
    overflow: auto;
    min-height: 0;
    padding: 14px 16px 24px;
    -webkit-overflow-scrolling: touch;
}

.sistema-pncd-ficha {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--pncd-radius);
    background: var(--pncd-surface);
    color: var(--pncd-text);
    color-scheme: light;
    box-shadow: var(--pncd-shadow);
}

.sistema-pncd-titulo {
    text-align: center;
    margin-bottom: 12px;
}

.sistema-pncd-titulo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.sistema-pncd-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sistema-pncd-badge.rascunho {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.sistema-pncd-badge.salva {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.sistema-pncd-data-destaque {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.sistema-pncd-passos-nav {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
}

.sistema-pncd-passos-nav .botao {
    flex: 1 1 0;
    min-height: 44px;
    border-radius: 10px;
    font-weight: 700;
}

.sistema-pncd-passos-nav .botao.azul {
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.sistema-pncd-aba.feita {
    opacity: 1;
}

.sistema-pncd-foto-bloco {
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed #64748b;
    border-radius: var(--radius-sm);
    background: #fff;
}

.sistema-pncd-foto-topo {
    display: grid;
    gap: 2px;
    margin-bottom: 10px;
}

.sistema-pncd-foto-topo strong {
    font-size: 0.9rem;
}

.sistema-pncd-foto-topo span {
    font-size: 0.75rem;
    color: #475569;
}

.sistema-pncd-foto-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.sistema-pncd-foto-acoes .botao,
.sistema-pncd-foto-acoes .sistema-pncd-upload-label {
    flex: 1 1 160px;
    min-width: 148px;
    justify-content: center;
    white-space: nowrap;
}

.sistema-pncd-upload-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sistema-pncd-fotos-grid {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

@media (min-width: 720px) {
    .sistema-pncd-fotos-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.sistema-pncd-foto-preview {
    margin: 0;
}

.sistema-pncd-foto-preview img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    border: 1px solid #cbd5e1;
}

.sistema-pncd-foto-preview figcaption {
    margin-top: 6px;
    font-size: 0.72rem;
    color: #64748b;
}

.sistema-pncd-foto-vazio {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

.sistema-pncd-ocr-painel {
    margin-top: 10px;
}

.sistema-pncd-ocr-painel.oculta {
    display: none;
}

.sistema-pncd-ocr-card {
    padding: 12px;
    border-radius: var(--radius-xs);
    border: 1px solid #93c5fd;
    background: #eff6ff;
}

.sistema-pncd-ocr-card > strong {
    display: block;
    margin-bottom: 4px;
}

.sistema-pncd-ocr-card > p {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: #1e3a8a;
}

.sistema-pncd-ocr-lista {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.sistema-pncd-ocr-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: start;
    padding: 8px;
    border-radius: var(--radius-xs);
    background: #fff;
    border: 1px solid #bfdbfe;
}

.sistema-pncd-ocr-item em {
    display: block;
    font-style: normal;
    font-size: 0.72rem;
    color: #64748b;
}

.sistema-pncd-ocr-item strong {
    font-size: 0.88rem;
    color: #0f172a;
    word-break: break-word;
}

.sistema-pncd-ocr-vazio {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: #9a3412;
}

.sistema-pncd-ocr-bruto {
    margin-top: 10px;
    font-size: 0.78rem;
}

.sistema-pncd-ocr-bruto summary {
    cursor: pointer;
    color: #1e3a8a;
}

.sistema-pncd-ocr-bruto pre {
    margin: 8px 0 0;
    max-height: 180px;
    overflow: auto;
    padding: 8px;
    border-radius: var(--radius-xs);
    background: #fff;
    border: 1px solid #bfdbfe;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.72rem;
    line-height: 1.35;
}

.sistema-pncd-rodape-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.sistema-pncd-rodape-acoes .botao,
.sistema-pncd-rodape-acoes .sistema-pncd-upload-label {
    min-height: 42px;
}

.sistema-pncd-painel .botao.admin-danger,
.sistema-pncd-painel .botao.admin-small.admin-danger {
    background: #b91c1c;
    border-color: #991b1b;
    color: #fff;
}

.sistema-pncd-painel .botao.admin-small {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.sistema-pncd-titulo h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sistema-pncd-titulo p {
    margin: 4px 0 0;
    font-size: 0.82rem;
    font-weight: 600;
}

.sistema-pncd-secao {
    margin-bottom: 14px;
}

.sistema-pncd-secao > h4,
.sistema-pncd-secao-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(13, 148, 136, 0.25);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pncd-teal-dark);
}

.sistema-pncd-secao-titulo i {
    width: 1.5rem;
    text-align: center;
    color: var(--pncd-teal);
}

.sistema-pncd-legenda-atividade {
    margin: 0 0 8px;
    font-size: 0.68rem;
    line-height: 1.35;
    color: #475569;
}

.sistema-pncd-cab-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid #64748b;
    border-radius: var(--radius-xxs);
    overflow: visible;
    background: #94a3b8;
}

.sistema-pncd-cab-grid label {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 4px 6px;
    border: none;
    font-size: 0.68rem;
    font-weight: 600;
    background: #fff;
}

.sistema-pncd-cab-grid label span {
    font-size: 0.62rem;
    color: #475569;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
}

.sistema-pncd-cab-grid input,
.sistema-pncd-cab-grid select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 28px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-xxs);
    font: inherit;
    font-size: 0.72rem;
    color: #0f172a;
    background: #fff;
}

.sistema-pncd-cab-grid .full,
.sistema-pncd-cab-grid label.wide,
.sistema-pncd-cab-grid .wide {
    grid-column: 1 / -1;
}

.sistema-pncd-cab-grid label.span-2,
.sistema-pncd-cab-grid .span-2 {
    grid-column: 2 / -1;
}

.sistema-pncd-cab-acao {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    min-width: 0;
    padding: 4px 6px;
    background: #fff;
    font-size: 0.68rem;
    font-weight: 600;
}

.sistema-pncd-cab-acao span {
    font-size: 0.62rem;
    color: #475569;
    line-height: 1.2;
}

.sistema-pncd-ficha .sistema-pncd-cab-acao .botao.compact {
    width: 100%;
    min-height: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 0.72rem;
    justify-content: center;
    white-space: nowrap;
}

.sistema-pncd-cab-grid input[type="date"],
.sistema-pncd-linha-grid input[type="date"],
.sistema-pncd-linha-grid input[type="time"] {
    min-width: 0;
    max-width: 100%;
}

.sistema-pncd-cab-grid input[type="date"]::-webkit-datetime-edit,
.sistema-pncd-linha-grid input[type="date"]::-webkit-datetime-edit,
.sistema-pncd-linha-grid input[type="time"]::-webkit-datetime-edit {
    min-width: 0;
    overflow: hidden;
}

.sistema-pncd-abas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    padding: 6px;
    border-radius: 12px;
    background: #e2e8f0;
    border: 1px solid var(--pncd-border);
}

.sistema-pncd-abas::-webkit-scrollbar {
    display: none;
}

.sistema-pncd-aba {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 52px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.sistema-pncd-aba-indice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.68rem;
    line-height: 1;
}

.sistema-pncd-aba-texto {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-align: center;
    line-height: 1.15;
    white-space: normal;
}

.sistema-pncd-aba-texto i {
    font-size: 0.78rem;
    opacity: 0.85;
}

.sistema-pncd-aba.ativa {
    background: linear-gradient(145deg, var(--pncd-blue), var(--pncd-blue-dark));
    border-color: var(--pncd-blue-dark);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.sistema-pncd-aba.ativa .sistema-pncd-aba-indice {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.sistema-pncd-aba.feita:not(.ativa) {
    background: rgba(13, 148, 136, 0.12);
    border-color: rgba(13, 148, 136, 0.35);
    color: var(--pncd-teal-dark);
}

.sistema-pncd-aba.feita:not(.ativa) .sistema-pncd-aba-indice {
    background: var(--pncd-teal);
    color: #fff;
}

.sistema-pncd-dica-tabela {
    margin: 0 0 8px;
    font-size: 0.72rem;
    color: #64748b;
}

.sistema-pncd-subtitulo {
    margin: 16px 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
}

/* Cards de visita — sempre empilhados (sem tabela com scroll lateral) */
.sistema-pncd-visitas-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sistema-pncd-linha-card {
    border: 1px solid var(--pncd-border);
    border-radius: 12px;
    background: var(--pncd-card);
    overflow: visible;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    border-left: 4px solid var(--pncd-teal);
}

.sistema-pncd-linha-card-topo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.12), rgba(37, 99, 235, 0.06));
    font-size: 0.78rem;
    border-bottom: 1px solid #e2e8f0;
}

.sistema-pncd-linha-card-topo strong {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pncd-teal);
    color: #fff;
    font-size: 0.72rem;
}

.sistema-pncd-linha-card-topo span {
    flex: 1;
    min-width: 0;
    color: #475569;
    font-size: 0.68rem;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.sistema-pncd-linha-card-topo .botao {
    flex-shrink: 0;
    min-width: 32px;
    padding: 4px 8px;
}

.sistema-pncd-linha-grupo {
    padding: 6px 8px;
    border-top: 1px solid #e2e8f0;
}

.sistema-pncd-linha-grupo:first-of-type {
    border-top: 0;
}

.sistema-pncd-linha-grupo > strong {
    display: block;
    margin: 0 0 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
}

.sistema-pncd-linha-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.sistema-pncd-linha-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sistema-pncd-linha-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sistema-pncd-linha-grid--essencial {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sistema-pncd-linha-grid label.wide {
    grid-column: 1 / -1;
}

.sistema-pncd-linha-grid label.span-2 {
    grid-column: span 2;
}

.sistema-pncd-linha-grid label {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: 0.62rem;
    font-weight: 600;
    color: #475569;
}

.sistema-pncd-linha-grid label span {
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
}

.sistema-pncd-linha-grid input,
.sistema-pncd-linha-grid select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--pncd-border);
    border-radius: 8px;
    font: inherit;
    font-size: 0.82rem;
    color: var(--pncd-text);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sistema-pncd-ficha input:focus,
.sistema-pncd-ficha select:focus {
    outline: none;
    border-color: var(--pncd-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.sistema-pncd-depositos-bloco {
    padding: 0 8px 8px;
}

.sistema-pncd-depositos-rotulo {
    display: block;
    margin-bottom: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
}

.sistema-pncd-linha-detalhe {
    border-top: 1px solid #e2e8f0;
    padding: 0 8px 8px;
}

.sistema-pncd-linha-detalhe summary {
    padding: 6px 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
}

.sistema-pncd-depositos-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}

.sistema-pncd-mini-campo {
    display: grid;
    gap: 1px;
    min-width: 0;
    font-size: 0.58rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
}

.sistema-pncd-mini-campo span {
    overflow: visible;
    white-space: nowrap;
}

.sistema-pncd-mini-campo input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    padding: 4px;
    border: 1px solid var(--pncd-border);
    border-radius: 8px;
    font: inherit;
    font-size: 0.78rem;
    text-align: center;
    background: #fff;
    color: var(--pncd-text);
    color-scheme: light;
}

.sistema-pncd-mini-campo input:focus {
    border-color: var(--pncd-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.sistema-pncd-ficha input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.sistema-pncd-ficha input[type="number"]::-webkit-inner-spin-button,
.sistema-pncd-ficha input[type="number"]::-webkit-outer-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

/* Resumo em cards */
.sistema-pncd-resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.sistema-pncd-resumo-card {
    padding: 12px 14px;
    border: 1px solid var(--pncd-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.sistema-pncd-resumo-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pncd-teal-dark);
}

.sistema-pncd-resumo-card p {
    margin: 0 0 4px;
    color: #475569;
    line-height: 1.4;
}

.sistema-pncd-resumo-card p:last-child {
    margin-bottom: 0;
}

.sistema-pncd-legenda {
    margin-top: 8px;
    font-size: 0.62rem;
    line-height: 1.35;
    color: #475569;
}

.sistema-pncd-legenda p {
    margin: 0 0 4px;
}

.sistema-pncd-visitas-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}

.sistema-pncd-visitas-toolbar--rodape {
    margin-top: 16px;
    margin-bottom: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.sistema-pncd-visitas-toolbar .botao {
    flex: 1 1 120px;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    white-space: nowrap;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.sistema-pncd-assinaturas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.sistema-pncd-assinatura-bloco {
    padding: 10px;
    border: 1px solid #64748b;
    border-radius: var(--radius-xxs);
    background: #fff;
    min-height: 72px;
}

.sistema-pncd-assinatura-bloco strong {
    display: block;
    font-size: 0.72rem;
    margin-bottom: 6px;
}

.sistema-pncd-assinatura-bloco p {
    margin: 2px 0;
    font-size: 0.72rem;
}

.sistema-pncd-assinatura-hint {
    font-size: 0.62rem !important;
    color: #64748b;
}

.sistema-pncd-assinatura-bloco input {
    width: 100%;
    margin-top: 8px;
    min-height: 28px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-xxs);
    font: inherit;
    font-size: 0.72rem;
}

.sistema-pncd-rodape {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    padding: 14px 18px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(2, 8, 23, 0.88);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

.sistema-pncd-rodape .botao {
    flex: 1 1 calc(50% - 5px);
    min-height: 50px;
    justify-content: center;
    touch-action: manipulation;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.sistema-pncd-status {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 0.82rem;
    color: var(--muted, #9fb3d9);
    line-height: 1.35;
}

@media (max-width: 900px) {
    .sistema-pncd-secao-oculta {
        display: none;
    }

    .sistema-pncd-dica-tabela {
        font-size: 0.68rem;
        margin: 0 0 6px;
        color: #64748b;
    }

    .sistema-pncd-topo {
        gap: 6px;
        padding: 8px 10px;
        padding-top: max(8px, env(safe-area-inset-top));
    }

    .sistema-pncd-topo h2 {
        font-size: 0.95rem;
    }

    .sistema-pncd-topo p {
        display: none;
    }

    .sistema-pncd-ficha {
        padding: 8px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .sistema-pncd-titulo {
        margin-bottom: 6px;
    }

    .sistema-pncd-titulo h3 {
        font-size: 0.88rem;
        margin: 2px 0;
    }

    .sistema-pncd-titulo p {
        font-size: 0.72rem;
        margin: 0;
    }

    .sistema-pncd-titulo-meta {
        gap: 6px;
        margin-bottom: 2px;
    }

    .sistema-pncd-secao {
        margin-bottom: 8px;
    }

    .sistema-pncd-secao > h4 {
        margin: 0 0 6px;
        font-size: 0.72rem;
    }

    .sistema-pncd-corpo {
        padding: 6px 6px 12px;
    }

    .sistema-pncd-abas {
        position: sticky;
        top: 0;
        z-index: 3;
        gap: 4px;
        margin: 0 -6px 8px;
        padding: 6px;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }

    .sistema-pncd-aba {
        flex: 1 1 auto;
        min-width: min-content;
        min-height: 36px;
        padding: 6px 8px;
        font-size: 0.68rem;
        text-align: center;
        white-space: nowrap;
    }

    .sistema-pncd-passos-nav {
        gap: 6px;
        margin: 0 0 8px;
    }

    .sistema-pncd-passos-nav .botao {
        min-height: 40px;
        font-size: 0.82rem;
    }

    .sistema-pncd-cab-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sistema-pncd-cab-grid label {
        padding: 4px 5px;
    }

    .sistema-pncd-cab-grid label.wide,
    .sistema-pncd-cab-grid .full,
    .sistema-pncd-cab-grid .wide {
        grid-column: 1 / -1;
    }

    .sistema-pncd-cab-grid label.span-2,
    .sistema-pncd-cab-grid .span-2 {
        grid-column: 2 / -1;
    }

    .sistema-pncd-cab-acao .botao {
        min-height: 34px;
    }

    .sistema-pncd-cab-grid input,
    .sistema-pncd-cab-grid select,
    .sistema-pncd-linha-grid input,
    .sistema-pncd-linha-grid select,
    .sistema-pncd-assinatura-bloco input,
    .sistema-pncd-mini-campo input {
        min-height: 34px;
        font-size: 16px;
        padding: 3px 4px;
    }

    .sistema-pncd-linha-card-topo {
        gap: 6px;
        align-items: center;
    }

    .sistema-pncd-linha-card-topo .botao {
        min-width: 36px;
        min-height: 36px;
    }

    .sistema-pncd-foto-bloco {
        margin-top: 8px;
        padding: 8px;
        border-radius: var(--radius-xs);
    }

    .sistema-pncd-foto-topo {
        margin-bottom: 6px;
    }

    .sistema-pncd-foto-topo strong {
        font-size: 0.78rem;
    }

    .sistema-pncd-foto-topo span {
        font-size: 0.68rem;
        line-height: 1.3;
    }

    .sistema-pncd-foto-acoes {
        gap: 6px;
        margin-bottom: 6px;
    }

    .sistema-pncd-foto-acoes .botao,
    .sistema-pncd-foto-acoes .sistema-pncd-upload-label {
        min-height: 40px;
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        font-size: 0.72rem;
        padding-inline: 6px;
        white-space: normal;
        line-height: 1.15;
    }

    .sistema-pncd-foto-preview img {
        max-height: 140px;
        border-radius: var(--radius-xxs);
    }

    .sistema-pncd-fotos-grid {
        gap: 6px;
    }

    .sistema-pncd-visitas-toolbar {
        gap: 6px;
        margin-bottom: 6px;
    }

    .sistema-pncd-visitas-toolbar .botao {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        min-height: 40px;
        font-size: 0.78rem;
        padding-inline: 6px;
        white-space: nowrap;
    }

    .sistema-pncd-rodape {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px 10px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .sistema-pncd-rodape-acoes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .sistema-pncd-rodape-acoes .botao,
    .sistema-pncd-rodape-acoes .sistema-pncd-upload-label {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        font-size: 0.78rem;
        padding-inline: 4px;
    }

    .sistema-pncd-status {
        grid-column: 1 / -1;
        font-size: 0.72rem;
    }

    .sistema-pncd-rodape .botao {
        width: 100%;
        flex: unset;
    }

    .sistema-pncd-acoes-topo {
        width: 100%;
        justify-content: stretch;
        gap: 6px;
    }

    .sistema-pncd-acoes-topo .botao {
        flex: 1 1 0;
        min-width: 0;
        min-height: 40px;
        font-size: 0.72rem;
        padding-inline: 4px;
        white-space: normal;
        line-height: 1.15;
    }

    .sistema-pncd-assinatura-bloco {
        padding: 8px;
    }

    .sistema-pncd-assinaturas-grid {
        gap: 8px;
    }

    .sistema-pncd-hist-item {
        padding: 10px;
        gap: 8px;
    }

    .sistema-pncd-ocr-card {
        padding: 8px;
    }
}

@media (min-width: 901px) {
    .sistema-pncd-abas,
    .sistema-pncd-passos-nav {
        display: none;
    }

    .sistema-pncd-secao-oculta {
        display: block;
    }
}

@media (max-width: 720px) {
    .sistema-pncd-assinaturas-grid {
        grid-template-columns: 1fr;
    }

    .sistema-pncd-depositos-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 3px;
    }

    .sistema-pncd-mini-campo span {
        font-size: 0.52rem;
    }
}

.sistema-pncd-painel.modo-historico .sistema-pncd-rodape-acoes {
    display: none;
}

.sistema-pncd-historico {
    max-width: 720px;
    margin: 0 auto;
}

.sistema-pncd-historico-topo {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.sistema-pncd-historico-topo h3 {
    margin: 0;
    font-size: 1.05rem;
}

.sistema-pncd-historico-topo p {
    margin: 4px 0 0;
    color: var(--muted, #9fb3d9);
    font-size: 0.85rem;
}

.sistema-pncd-hist-lista {
    display: grid;
    gap: 10px;
}

.sistema-pncd-hist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.06);
}

.sistema-pncd-hist-item strong {
    display: block;
    font-size: 1rem;
}

.sistema-pncd-hist-item p {
    margin: 4px 0;
    font-size: 0.92rem;
}

.sistema-pncd-hist-item small {
    display: block;
    color: var(--muted, #9fb3d9);
    font-size: 0.78rem;
}

.sistema-pncd-hist-quando {
    margin-top: 2px;
    opacity: 0.85;
}

.sistema-pncd-hist-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.sistema-pncd-hist-vazio {
    padding: 24px 12px;
    text-align: center;
    color: var(--muted, #9fb3d9);
}

html.light-theme .sistema-pncd-hist-item,
body.light-theme .sistema-pncd-hist-item {
    border-color: rgba(14, 91, 166, 0.16);
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
}

html.light-theme .sistema-pncd-hist-item small,
body.light-theme .sistema-pncd-hist-item small,
html.light-theme .sistema-pncd-historico-topo p,
body.light-theme .sistema-pncd-historico-topo p,
html.light-theme .sistema-pncd-hist-vazio,
body.light-theme .sistema-pncd-hist-vazio {
    color: #64748b;
}

/* Guia de foto + revisão rápida IA */
.sistema-pncd-foto-guia {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
    align-items: center;
    margin: 0 0 8px;
    padding: 8px;
    border: 1px dashed #64748b;
    border-radius: var(--radius-xs);
    background: #f1f5f9;
}

.sistema-pncd-foto-guia-frame {
    position: relative;
    width: 72px;
    height: 56px;
    border: 2px solid #0f766e;
    border-radius: var(--radius-xxs);
    background:
        linear-gradient(90deg, rgba(15, 118, 110, 0.12) 0 12%, transparent 12% 88%, rgba(15, 118, 110, 0.12) 88%),
        linear-gradient(#e2e8f0, #e2e8f0);
}

.sistema-pncd-foto-guia-frame::before,
.sistema-pncd-foto-guia-frame::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed rgba(15, 118, 110, 0.55);
    pointer-events: none;
}

.sistema-pncd-foto-guia-frame span {
    position: absolute;
    inset: 14px 10px;
    background: repeating-linear-gradient(
        transparent,
        transparent 3px,
        rgba(15, 118, 110, 0.2) 3px,
        rgba(15, 118, 110, 0.2) 4px
    );
}

.sistema-pncd-foto-guia ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.68rem;
    line-height: 1.35;
    color: #334155;
}

.sistema-pncd-foto-guia li + li {
    margin-top: 2px;
}

.sistema-pncd-revisao-ia {
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid #0f766e;
    border-radius: var(--radius-xs);
    background: linear-gradient(180deg, #ecfdf5, #f8fafc);
}

.sistema-pncd-revisao-ia > header {
    display: grid;
    gap: 2px;
    margin-bottom: 8px;
}

.sistema-pncd-revisao-ia > header strong {
    font-size: 0.82rem;
    color: #065f46;
}

.sistema-pncd-revisao-ia > header span {
    font-size: 0.68rem;
    color: #475569;
}

.sistema-pncd-revisao-lista {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: grid;
    gap: 6px;
    max-height: 42vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.sistema-pncd-revisao-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-xs);
    background: #fff;
    font-size: 0.72rem;
    color: #334155;
}

.sistema-pncd-revisao-item strong {
    grid-row: 1 / span 3;
    align-self: center;
    color: #0f766e;
    font-size: 0.78rem;
}

.sistema-pncd-revisao-rua {
    grid-column: 2;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.sistema-pncd-revisao-deps {
    grid-column: 2;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.sistema-pncd-revisao-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sistema-pncd-revisao-acoes .botao {
    flex: 1 1 calc(50% - 4px);
    min-height: 40px;
    justify-content: center;
}

@media (max-width: 900px) {
    .sistema-pncd-foto-guia {
        grid-template-columns: 64px 1fr;
        gap: 6px;
        padding: 6px;
    }

    .sistema-pncd-foto-guia-frame {
        width: 64px;
        height: 50px;
    }

    .sistema-pncd-foto-guia ul {
        font-size: 0.62rem;
        padding-left: 1rem;
    }

    .sistema-pncd-revisao-ia {
        padding: 8px;
        position: sticky;
        top: 42px;
        z-index: 2;
    }

    .sistema-pncd-revisao-acoes .botao {
        min-height: 42px;
        font-size: 0.78rem;
    }

    .sistema-pncd-linha-card-topo .botao[data-acao="copiar-anterior"] {
        min-width: 0;
        padding-inline: 6px;
        font-size: 0.68rem;
    }
}

.sistema-pncd-modal-localidade {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.sistema-pncd-modal-localidade.oculta {
    display: none !important;
}

.sistema-pncd-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 23, 0.62);
}

.sistema-pncd-modal-painel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(520px, 100%);
    max-height: min(86dvh, 640px);
    overflow: hidden;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 14px 14px 12px;
    box-shadow: 0 24px 70px rgba(2, 8, 23, 0.4);
}

.sistema-pncd-modal-painel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: #0f172a;
}

.sistema-pncd-modal-painel header strong {
    font-size: 1rem;
}

.sistema-pncd-modal-fechar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.sistema-pncd-modal-painel input[type="search"] {
    width: 100%;
    min-height: 42px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
}

.sistema-pncd-modal-lista {
    display: grid;
    gap: 8px;
    overflow: auto;
    min-height: 0;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
}

.sistema-pncd-modal-vazio {
    margin: 12px 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.sistema-pncd-localidade-opcao {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    text-align: left;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    padding: 10px 12px;
    cursor: pointer;
}

.sistema-pncd-localidade-opcao em {
    grid-row: 1 / span 2;
    align-self: center;
    font-style: normal;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #1d4ed8;
    min-width: 3.6rem;
}

.sistema-pncd-localidade-opcao span {
    grid-column: 2;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sistema-pncd-localidade-opcao small {
    grid-column: 2;
    color: #64748b;
    font-size: 0.75rem;
}

.sistema-pncd-localidade-opcao:hover,
.sistema-pncd-localidade-opcao:focus-visible {
    border-color: #2563eb;
    background: #eff6ff;
    outline: none;
}

.sistema-pncd-localidade-opcao.ativa {
    border-color: #2563eb;
    background: #dbeafe;
    box-shadow: inset 0 0 0 1px #2563eb;
}

@media (min-width: 640px) {
    .sistema-pncd-modal-localidade {
        align-items: center;
        padding: 24px;
    }
}

.sistema-pncd-inicio-import {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 16px;
    padding: 16px 18px;
    border: 1px solid rgba(13, 148, 136, 0.45);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.14), rgba(37, 99, 235, 0.1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.sistema-pncd-inicio-import-texto strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 1.02rem;
    color: var(--pncd-teal-dark);
}

.sistema-pncd-inicio-import-texto strong::before {
    content: "\f019";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--pncd-teal);
}

.sistema-pncd-inicio-import-texto p {
    margin: 0;
    opacity: 0.92;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--pncd-muted);
}

.sistema-pncd-inicio-import-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sistema-pncd-inicio-import-acoes .botao {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 700;
}

.sistema-pncd-escolha-loc {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(37, 99, 235, 0.4);
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
}

.sistema-pncd-escolha-loc strong {
    display: block;
    margin-bottom: 6px;
    color: var(--pncd-blue-dark, #1d4ed8);
}

.sistema-pncd-escolha-loc p {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: var(--pncd-muted);
}

.sistema-pncd-escolha-loc-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sistema-pncd-aviso-catalogo {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sistema-pncd-foto-opcional {
    margin-top: 14px;
    border: 1px dashed var(--pncd-border, #cbd5e1);
    border-radius: 12px;
    padding: 4px 10px 10px;
    background: #f8fafc;
}

.sistema-pncd-foto-opcional > summary {
    cursor: pointer;
    font-weight: 700;
    padding: 10px 4px;
    color: #475569;
}

.sistema-pncd-foto-opcional .sistema-pncd-foto-bloco {
    margin-top: 4px;
    border: 0;
    padding: 4px 0 0;
    background: transparent;
    box-shadow: none;
}

/* Botões dentro do painel PNCD */
.sistema-pncd-painel .botao.verde {
    background: linear-gradient(145deg, #059669, #047857);
    border-color: #047857;
}

.sistema-pncd-painel .botao.azul {
    background: linear-gradient(145deg, var(--pncd-blue), var(--pncd-blue-dark));
    border-color: var(--pncd-blue-dark);
}

.sistema-pncd-painel .botao.neutro {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.sistema-pncd-assinatura-bloco {
    padding: 14px;
    border: 1px solid var(--pncd-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    min-height: 88px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.sistema-pncd-foto-bloco {
    margin-top: 14px;
    padding: 14px;
    border: 1px dashed var(--pncd-teal);
    border-radius: 12px;
    background: rgba(13, 148, 136, 0.04);
}

.sistema-pncd-painel.modo-historico .sistema-pncd-ficha {
    padding-top: 12px;
}

@media (max-width: 900px) {
    .sistema-pncd-abas {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        grid-template-columns: unset;
    }

    .sistema-pncd-aba {
        flex: 1 1 88px;
        min-width: 88px;
    }
}
