#horizon-sge-app .h32-dialog{width:min(980px,calc(100vw - 24px));max-height:90dvh;border:1px solid #dce3ec;border-radius:18px;padding:0;color:#1e293b;background:#fff;box-shadow:0 24px 100px #0f172a60;margin:auto;overflow:auto}
#horizon-sge-app .h32-dialog::backdrop{background:#0f172a99;backdrop-filter:blur(3px)}
#horizon-sge-app .h32-dialog>header{display:flex;align-items:center;justify-content:space-between;padding:22px 28px;background:#eff6ff;border-bottom:1px solid #dbeafe;gap:20px}
#horizon-sge-app .h32-dialog small{font-size:10px;letter-spacing:1px;color:#475569}
#horizon-sge-app .h32-dialog h2{margin:5px 0 0;font-size:22px;color:#142e4c}
#horizon-sge-app .h32-dialog .h32-close{font-size:28px;line-height:1;border:0;background:transparent;cursor:pointer;color:inherit;padding:8px}
#horizon-sge-app .h32-body{padding:24px 28px}
#horizon-sge-app .h32-body>p{font-size:14px;margin:0 0 22px;color:#475569;line-height:1.6}
#horizon-sge-app .h32-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
#horizon-sge-app .h32-cpf-field{display:flex;flex-direction:column;gap:7px;min-width:0}
#horizon-sge-app .h32-cpf-controls{display:flex;gap:8px;align-items:stretch}
#horizon-sge-app .h32-cpf-controls input{flex:1;min-width:0}
#horizon-sge-app .h32-cpf-controls button{flex-shrink:0;border:1px solid #2563eb;border-radius:8px;padding:8px 12px;background:#eff6ff;color:#1d4ed8;font:600 12px/1.4 Inter,Arial,sans-serif;cursor:pointer}
#horizon-sge-app .h32-cpf-controls button:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}
#horizon-sge-app .h32-form label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:500;text-align:left;margin-bottom:15px}
#horizon-sge-app .h32-form .h32-grid label{margin-bottom:0}
#horizon-sge-app .h32-form label span{display:block}
#horizon-sge-app .h32-form b{color:#b91c1c}
#horizon-sge-app .h32-form input,#horizon-sge-app .h32-form textarea,#horizon-sge-app .h32-form select,#horizon-sge-app .h32-search input{width:100%;padding:10px 12px;min-height:42px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#1e293b;font:400 14px/1.4 Inter,Arial,sans-serif;box-sizing:border-box}
#horizon-sge-app .h32-form input[readonly],#horizon-sge-app .h32-form select:disabled{background:#f1f5f9;color:#475569}
#horizon-sge-app .h32-form .h32-check{display:flex;flex-direction:row;align-items:flex-start;gap:8px}
#horizon-sge-app .h32-form input[type=checkbox]{width:18px;height:18px;min-height:18px;flex-shrink:0}
#horizon-sge-app .h32-wide{grid-column:1/-1}
#horizon-sge-app .h32-note{font-size:12px;line-height:1.6;color:#475569;background:#f1f5f9;padding:12px;border-radius:8px;margin:18px 0}
#horizon-sge-app .h32-cpf-field .h32-note{margin:0;border:1px solid #cbd5e1;overflow-wrap:anywhere}
#horizon-sge-app .h32-cpf-field .h32-note[data-provider=disabled],#horizon-sge-app .h32-cpf-field .h32-note[data-provider=missing_birth]{background:#fffbeb;border-color:#d97706;color:#78350f}
#horizon-sge-app .h32-cpf-field .h32-note[data-provider=invalid],#horizon-sge-app .h32-cpf-field .h32-note[data-provider=error]{background:#fef2f2;border-color:#dc2626;color:#991b1b}
#horizon-sge-app .h32-cpf-field .h32-note[data-provider=success]{background:#f0fdf4;border-color:#16a34a;color:#166534}
#horizon-sge-app .h32-error{color:#b91c1c;font-size:13px;line-height:1.5}
#horizon-sge-app .h32-form footer,#horizon-sge-app .h32-archive footer{display:flex;gap:12px;align-items:center;justify-content:flex-end;margin-top:22px;flex-wrap:wrap}
#horizon-sge-app .h32-first-link{width:100%;padding:14px 10px;background:transparent;color:#2563eb;border:0;font-weight:600;font-size:13px;cursor:pointer;margin-top:10px}
#horizon-sge-app .h32-archive{background:var(--hx-card,#fff);border-radius:16px;padding:24px;color:var(--hx-text,#1e293b)}
#horizon-sge-app .h32-archive header{margin-bottom:20px}
#horizon-sge-app .h32-archive header small{font-size:11px;letter-spacing:1px;color:var(--hx-muted,#64748b)}
#horizon-sge-app .h32-archive h2{font-size:25px;margin:8px 0}
#horizon-sge-app .h32-archive p{font-size:14px}
#horizon-sge-app .h32-actions{display:flex;gap:8px;flex-wrap:wrap}
#horizon-sge-app .h32-actions button,#horizon-sge-app .h32-archive footer button,#horizon-sge-app .h32-cancel{border:1px solid #cbd5e1;background:#f8fafc;color:#203b5a;border-radius:7px;padding:8px 12px;font-size:12px;cursor:pointer;min-height:36px}
#horizon-sge-app .h32-search{display:flex;flex-direction:column;gap:8px;font-size:12px;margin:24px 0 18px;max-width:600px}
#horizon-sge-app .h32-table{overflow-x:auto}
#horizon-sge-app .h32-table table{width:100%;border-collapse:collapse;min-width:760px}
#horizon-sge-app .h32-table th,#horizon-sge-app .h32-table td{text-align:left;padding:13px 10px;border-bottom:1px solid #e2e8f0;vertical-align:top;font-size:12px}
#horizon-sge-app .h32-table td small{display:block;opacity:.7;margin-top:5px}
#horizon-sge-app .h32-table [hidden]{display:none!important}
#horizon-sge-app .h32-archive button:disabled,#horizon-sge-app .h32-form button:disabled{opacity:.5;cursor:wait}





@media(max-width:600px){#horizon-sge-app .h32-grid{grid-template-columns:1fr}#horizon-sge-app .h32-body,#horizon-sge-app .h32-dialog>header,#horizon-sge-app .h32-archive{padding:18px}#horizon-sge-app .h32-dialog h2{font-size:19px}#horizon-sge-app .h32-form footer button{flex:1}}
#horizon-sge-app .h34-filters{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin:22px 0 12px;padding:16px;background:#f3f7fa;border:1px solid #dce5ef;border-radius:12px}
#horizon-sge-app .h34-filters label{display:grid;gap:6px;font-size:12px;flex:1 1 220px;color:#344e66}
#horizon-sge-app .h34-filters input,#horizon-sge-app .h34-filters select{width:100%;min-height:40px;padding:8px 10px;border:1px solid #cddbe8;border-radius:8px}
#horizon-sge-app .h34-filters button{min-height:40px;padding:8px 14px;border:1px solid #cddbe8;border-radius:8px;background:#fff;color:#195f79;cursor:pointer}


@media(max-width:600px){#horizon-sge-app .h34-diagnostics table{min-width:0!important;width:100%}#horizon-sge-app .h34-diagnostics thead{display:none}#horizon-sge-app .h34-diagnostics tr{display:block;padding:12px 0;border-bottom:1px solid #dce5ef}#horizon-sge-app .h34-diagnostics td{display:block;width:100%!important;padding:6px 0!important;border:0!important;white-space:normal!important}#horizon-sge-app .h34-diagnostics td:first-child{font-weight:700}#horizon-sge-app .h34-diagnostics button{min-height:40px}}


/* HORIZON SGE 29.8 — anexos protegidos do cadastro */
#horizon-sge-app .h38-attachments{grid-column:1/-1;margin:24px 0 6px;padding:20px;border:1px solid #d7e4f1;border-radius:16px;background:linear-gradient(180deg,#f8fbff,#f2f7fc)}
#horizon-sge-app .h38-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}
#horizon-sge-app .h38-section-head small{color:#1A75D3!important;font-weight:800;letter-spacing:.08em}
#horizon-sge-app .h38-section-head h3{margin:3px 0 5px;color:#16324a;font-size:19px}
#horizon-sge-app .h38-section-head p{margin:0;color:#607489;font-size:12px;line-height:1.5}
#horizon-sge-app .h38-section-head>span{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;background:#e7f2fc;color:#004A99;border:1px solid #c9e0f5;border-radius:999px;padding:7px 10px;font-size:11px;font-weight:700}
#horizon-sge-app .h38-photo-card{display:grid;grid-template-columns:118px 1fr;gap:18px;align-items:center;padding:16px;border:1px solid #d7e4f1;border-radius:14px;background:#fff;margin-bottom:16px}
#horizon-sge-app .h38-photo-preview{width:108px;aspect-ratio:3/4;border-radius:12px;overflow:hidden;background:#eaf2f9;display:grid;place-items:center;color:#6f8aa3;font-size:34px;border:1px solid #d5e1ed}
#horizon-sge-app .h38-photo-preview img{width:100%;height:100%;object-fit:cover}
#horizon-sge-app .h38-photo-card strong{color:#173552;font-size:15px}
#horizon-sge-app .h38-photo-card p{font-size:12px;color:#607489;margin:5px 0 10px;line-height:1.45}
#horizon-sge-app .h38-doc-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#horizon-sge-app .h38-doc-card{padding:14px;border:1px solid #d7e4f1;border-radius:14px;background:#fff;min-width:0}
#horizon-sge-app .h38-doc-card>header{display:flex;gap:10px;align-items:flex-start;margin-bottom:10px}
#horizon-sge-app .h38-doc-card>header strong{display:block;color:#173552;font-size:13px}
#horizon-sge-app .h38-doc-card>header p{font-size:11px;color:#6a7d90;margin:3px 0 0;line-height:1.4}
#horizon-sge-app .h38-doc-icon{width:34px;height:34px;border-radius:10px;background:#e9f3fd;color:#1A75D3;display:grid;place-items:center;flex:0 0 34px}
#horizon-sge-app .h38-file-list{display:grid;gap:7px;margin:8px 0 10px}
#horizon-sge-app .h38-empty-file{font-size:11px;color:#8090a0;padding:8px 0}
#horizon-sge-app .h38-file-row{display:flex;justify-content:space-between;align-items:center;gap:10px;border:1px solid #e0e9f2;background:#f8fbfd;border-radius:10px;padding:8px 9px;min-width:0}
#horizon-sge-app .h38-file-row>div{display:flex;align-items:center;gap:8px;min-width:0}
#horizon-sge-app .h38-file-row>div>i{color:#1A75D3}
#horizon-sge-app .h38-file-row span span{min-width:0}
#horizon-sge-app .h38-file-row strong{display:block;font-size:11px;color:#29445e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px}
#horizon-sge-app .h38-file-row small{display:block;font-size:10px;color:#7a8d9f;margin-top:2px}
#horizon-sge-app .h38-file-actions{display:flex;gap:7px;align-items:center;flex-shrink:0}
#horizon-sge-app .h38-file-actions a,#horizon-sge-app .h38-file-actions button,#horizon-sge-app .h38-remove-photo{font:600 10px/1.2 Inter,Arial,sans-serif;border:0;background:transparent;color:#005eac;padding:5px;cursor:pointer;text-decoration:none}
#horizon-sge-app .h38-file-actions button,#horizon-sge-app .h38-remove-photo{color:#a22a2a}
#horizon-sge-app .h38-upload-btn{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:7px!important;width:auto!important;margin:0!important;padding:9px 11px;border:1px solid #bad4ec;border-radius:9px;background:#eef6fd;color:#00599f!important;font-size:11px!important;font-weight:700!important;cursor:pointer}
#horizon-sge-app .h38-doc-card>small,#horizon-sge-app .h38-photo-card small[data-photo-status]{display:block;color:#61788e;font-size:10px;margin-top:7px}
@media(max-width:760px){#horizon-sge-app .h38-doc-grid{grid-template-columns:1fr}#horizon-sge-app .h38-section-head{flex-direction:column}#horizon-sge-app .h38-photo-card{grid-template-columns:92px 1fr}.h38-photo-preview{width:88px!important}#horizon-sge-app .h38-file-row{align-items:flex-start;flex-direction:column}#horizon-sge-app .h38-file-actions{width:100%;justify-content:flex-end}}

/* 30.11.4 — identidade única e entrada municipal direta */
.hsg314-direct-panel{margin:14px 0;padding:14px 16px;border:1px solid #a9c9e9;border-radius:12px;background:rgba(26,117,211,.055)}
.hsg314-direct-panel h3{color:#004a99;font-size:15px;margin:0 0 5px}.hsg314-direct-panel p{margin:0 0 10px}
.hsg314-open-existing{display:inline-block;margin:4px 6px;padding:6px 9px;border:1px solid #1a75d3;border-radius:7px;background:#fff;color:#004a99;cursor:pointer}
