:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --muted: #64748b;
    --line: #dbe3ef;
    --primary: #165baa;
    --primary-dark: #0f4380;
    --success: #0f8b62;
    --warning: #b7791f;
    --danger: #b42318;
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}
.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .5px;
}
.brand-title { font-size: 17px; font-weight: 800; }
.brand-subtitle { font-size: 12px; color: var(--muted); }
.topnav { display: flex; gap: 8px; align-items: center; }
.topnav a {
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
}
.topnav a:hover { background: var(--surface-soft); text-decoration: none; }

.main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 22px 44px;
}
.footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 22px 34px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: stretch;
    margin-bottom: 26px;
}
.hero, .card, .emenda-card, .protocol-card, .login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero { padding: 34px; }
.eyebrow {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 8px;
}
.hero h1, .page-title h1, .login-card h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.1;
}
.hero p, .page-title p, .section-header p, .login-card p {
    color: var(--muted);
    margin: 0;
    max-width: 760px;
}
.hero-card {
    border-radius: 16px;
    background: linear-gradient(135deg, #f0f7ff, #ffffff);
    border: 1px solid #d8e9fb;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
.hero-number { font-size: 54px; font-weight: 900; color: var(--primary); line-height: 1; }
.hero-label { margin-top: 8px; color: var(--muted); font-weight: 600; }

.card { padding: 26px; margin-bottom: 22px; }
.section-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.section-header h2 { margin: 0 0 6px; font-size: 21px; }

.selector-form label, .form-group label, .login-card label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}
.input, .textarea, select.input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    padding: 12px 13px;
    font: inherit;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(22, 91, 170, .12);
}
.input:disabled, .textarea:disabled {
    background: #f1f5f9;
    color: #475569;
}
.textarea { resize: vertical; min-height: 150px; }
.input-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: end; }
.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #edf2f7; color: #1e293b; }
.btn-secondary:hover { background: #e2e8f0; }
.full-btn { width: 100%; margin-top: 18px; }

.info-grid, .emenda-grid, .grid-2, .readonly-grid {
    display: grid;
    gap: 16px;
}
.info-grid { grid-template-columns: repeat(3, 1fr); }
.info-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}
.info-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #e8f2ff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 900;
    margin-bottom: 12px;
}
.info-card h3 { margin: 0 0 8px; }
.info-card p { margin: 0; color: var(--muted); }

.page-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 10px 0 24px;
}
.back-link { display: inline-block; color: var(--muted); margin-bottom: 10px; font-weight: 700; }
.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.admin-summary { grid-template-columns: repeat(4, 1fr); }
.summary-strip > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.summary-strip strong { display: block; font-size: 24px; }
.summary-strip span { color: var(--muted); font-weight: 700; }

.emenda-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emenda-card { padding: 22px; }
.emenda-card-top { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 14px; }
.emenda-card h2 { margin: 4px 0 0; font-size: 22px; }
.emenda-tag {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8f2ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
}
.details-list { margin: 0; display: grid; gap: 11px; }
.details-list div { border-top: 1px solid var(--line); padding-top: 10px; }
.details-list dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.details-list dd { margin: 2px 0 0; font-weight: 700; }
.card-actions { margin-top: 18px; display: flex; justify-content: flex-end; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.badge-success { background: #e6f6ef; color: var(--success); }
.badge-warning { background: #fff7e6; color: var(--warning); }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-muted { background: #eef2f7; color: #475569; }
.status-box { min-width: 120px; text-align: right; }

.form-stack { display: block; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-group.full { grid-column: 1 / -1; }
.field-help { color: var(--muted); font-size: 13px; margin-top: 6px; }
.readonly-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.readonly-grid div {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}
.readonly-grid span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; margin-bottom: 4px; }
.readonly-grid strong { font-size: 15px; }
.notice {
    margin-top: 18px;
    border: 1px solid #cfe1f7;
    background: #f0f7ff;
    border-radius: 14px;
    padding: 14px;
    color: #173b61;
    font-weight: 600;
}
.notice.muted {
    background: #f8fafc;
    border-color: var(--line);
    color: var(--muted);
}
.radio-list { display: grid; gap: 10px; }
.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    background: #fff;
}
.radio-card:hover { border-color: var(--primary); background: #f8fbff; }
.radio-card input { margin-top: 3px; }
.radio-card span { font-weight: 700; }
.publico-outro-wrap { margin-top: 14px; }

.resource-table-wrap { overflow-x: auto; }
.resource-table, .data-table { width: 100%; border-collapse: collapse; }
.resource-table th, .resource-table td, .data-table th, .data-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}
.resource-table thead th, .data-table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.resource-table tfoot th { background: #f8fafc; }
.resource-table .input { min-width: 180px; }
.percent-cell { font-weight: 800; color: var(--primary); }
.check-line {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 700;
}
.check-line.ok { background: #e6f6ef; color: var(--success); }
.check-line.error { background: #fff1f0; color: var(--danger); }
.attachment-list { margin-top: 16px; display: grid; gap: 10px; }
.attachment-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
}
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: rgba(245,247,251,0.94);
    border-top: 1px solid var(--line);
    padding: 16px 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    backdrop-filter: blur(8px);
}

.protocol-card {
    padding: 30px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #0f4380, #165baa);
    color: #fff;
}
.protocol-label { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 900; opacity: .85; }
.protocol-number { font-size: 40px; font-weight: 900; margin-top: 6px; }
.protocol-meta { opacity: .88; margin-top: 6px; }
.print-note p { color: var(--muted); }

.login-wrap { min-height: 58vh; display: grid; place-items: center; }
.login-card { width: min(460px, 100%); padding: 30px; }
.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 700;
}
.alert-success { border-color: #bde8d5; background: #edfbf5; color: var(--success); }
.alert-danger { border-color: #ffd0cc; background: #fff4f2; color: var(--danger); }
.alert-warning { border-color: #f8df9d; background: #fff8e7; color: var(--warning); }
.empty-state, .empty-row { text-align: center; color: var(--muted); }

@media (max-width: 900px) {
    .hero, .emenda-grid, .grid-2, .readonly-grid, .info-grid, .summary-strip, .admin-summary { grid-template-columns: 1fr; }
    .input-row { grid-template-columns: 1fr; }
    .page-title { flex-direction: column; }
    .footer { flex-direction: column; gap: 6px; }
}

@media print {
    .topbar, .footer, .back-link, .sticky-actions { display: none !important; }
    body { background: #fff; }
    .main { max-width: none; padding: 0; }
    .card, .protocol-card { box-shadow: none; }
}
.callout {
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px 16px;
    margin: -4px 0 18px;
    color: var(--text);
    line-height: 1.55;
}
.callout code {
    background: #eef2f7;
    border: 1px solid #dde5ef;
    border-radius: 7px;
    padding: 2px 6px;
    font-size: 12px;
}

.field-error {
    min-height: 18px;
    margin-top: 6px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
}
.input-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .10) !important;
}
.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: .55;
}
.form-locked .radio-card {
    pointer-events: none;
    background: #f8fafc;
}
.form-locked .input:not([type="file"]),
.form-locked .textarea {
    background: #f8fafc;
    color: #334155;
}
.govbr-steps {
    border: 1px solid #cfe1f7;
    background: #f8fbff;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
}
.govbr-steps h3 {
    margin: 0 0 8px;
    font-size: 17px;
}
.govbr-steps ol {
    margin: 0 0 14px 18px;
    padding: 0;
    color: #334155;
}
.govbr-steps li {
    margin: 6px 0;
}
.upload-locked {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 13px 14px;
    margin-bottom: 12px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 700;
}
#card-exportacao .btn + .btn {
    margin-left: 8px;
}

.required-progress {
    border: 1px solid #dde7f2;
    background: #fbfdff;
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0 18px;
}
.required-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.required-progress-head strong {
    color: var(--text);
    font-size: 15px;
}
.required-progress-head strong.ok,
.ok-text {
    color: var(--success) !important;
}
.required-progress-track {
    height: 10px;
    background: #e8eef6;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}
.required-progress-bar {
    width: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width .2s ease;
}
.required-progress-bar.ok {
    background: var(--success);
}
.required-checklist {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    font-size: 13px;
}
.required-checklist li {
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.required-checklist li.ok {
    color: var(--success);
    border-color: rgba(23, 128, 82, .25);
    background: rgba(23, 128, 82, .05);
    font-weight: 700;
}
.required-checklist li.pending {
    color: #64748b;
}
@media (max-width: 720px) {
    .required-checklist {
        grid-template-columns: 1fr;
    }
}

.btn-small {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 13px;
}
.stacked-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}
.static-actions {
    position: static;
    background: transparent;
    border-top: 0;
    padding-bottom: 0;
}
.protocol-query-card label + .input {
    margin-bottom: 4px;
}
.validation-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
}
.admin-summary {
    grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1000px) {
    .admin-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .admin-summary { grid-template-columns: 1fr; }
}

.pdf-validation-status {
    margin-top: 12px;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}
.pdf-validation-status.ok {
    border-color: rgba(23, 128, 82, .35);
    background: rgba(23, 128, 82, .07);
    color: var(--success);
    font-weight: 700;
}
.pdf-validation-status.error {
    border-color: rgba(190, 18, 60, .35);
    background: rgba(190, 18, 60, .07);
    color: var(--danger);
    font-weight: 700;
}
.pdf-validation-status.loading {
    border-color: rgba(37, 99, 235, .30);
    background: rgba(37, 99, 235, .06);
    color: var(--primary);
    font-weight: 700;
}
.pdf-validation-status.neutral {
    border-color: #d7e0ea;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 500;
}

.admin-summary-wide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.protocol-card-admin .protocol-number,
.protocol-card .protocol-number {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.08;
}

.protocol-card:hover { 
	text-decoration: none;
}

.detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.validation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subsection-title {
    margin: 22px 0 12px;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-readonly-block {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.form-readonly-block span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 6px;
}
.form-readonly-block strong { display: block; }
.form-readonly-block p { margin: 0; color: var(--text); }
.table-responsive { overflow-x: auto; }
.document-actions {
    display: flex;
    justify-content: flex-end;
    margin: 16px 0 12px;
}
.pdf-frame-wrap {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
    min-height: 560px;
}
.pdf-frame {
    width: 100%;
    height: 660px;
    border: 0;
    display: block;
    background: #fff;
}
.status-action-form .textarea {
    min-height: 110px;
}
.protocol-detail-card .data-table tfoot th {
    background: #f8fafc;
    border-top: 2px solid var(--line);
}
@media (max-width: 1100px) {
    .admin-summary-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .detail-grid,
    .validation-grid,
    .admin-summary-wide { grid-template-columns: 1fr; }
    .protocol-card .protocol-number { font-size: 26px; }
    .pdf-frame { height: 520px; }
}

/* Ajustes v10.1 - detalhe completo do protocolo e pagamentos em lote */
.page-actions,
.filter-actions,
.payment-bulk-actions,
.status-quick-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.values-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.filter-card .filter-actions {
    margin-top: 18px;
}
.payment-table-header {
    align-items: flex-start;
}
.payment-summary strong {
    font-size: 21px;
}
.check-col {
    width: 46px;
    text-align: center;
}
.check-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.row-not-payable {
    background: #fafafa;
}
.row-not-payable td {
    color: #64748b;
}
.bulk-payment-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    margin: 18px -26px -26px;
    padding: 16px 26px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.bulk-payment-footer span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}
.hash-cell,
.user-agent-cell {
    max-width: 260px;
    overflow-wrap: anywhere;
    font-size: 12px;
    color: var(--muted);
}
.meta-separator {
    color: var(--line);
    margin: 0 8px;
}
.status-quick-actions {
    justify-content: flex-start;
    margin-top: 14px;
}
.status-quick-actions .btn-primary {
    margin-right: 8px;
}
.muted-text {
    color: var(--muted);
}
.protocol-card .badge {
    vertical-align: middle;
}
.protocol-card-admin {
    border-left: 6px solid var(--primary);
}

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .page-title,
    .bulk-payment-footer {
        align-items: stretch;
        flex-direction: column;
    }
    .page-actions,
    .payment-bulk-actions,
    .filter-actions,
    .status-quick-actions {
        justify-content: flex-start;
    }
    .grid-4,
    .values-inline {
        grid-template-columns: 1fr;
    }
}


.admin-action-card { margin-top: 22px; }
.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.admin-action-item {
    display: block;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
}
.admin-action-item:hover {
    background: #fff;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}
.admin-action-item strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--primary-900);
}
.admin-action-item span {
    display: block;
    color: var(--muted);
    line-height: 1.45;
}

.admin-user-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.login-help {
    margin-top: 12px;
}

.admin-users-table td {
    vertical-align: top;
}

.inline-admin-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.inline-admin-form.password-form {
    min-width: 180px;
}

.input-small {
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.user-admin-form .form-actions {
    margin-top: 12px;
}

@media (max-width: 900px) {
    .admin-user-chip { display: none; }
}

/* Ajustes v12.3 - identidade institucional, indicadores e tabelas com pesquisa/paginação */
:root {
    --border: var(--line);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --gov-navy: #0b2f57;
    --gov-blue: #1351a2;
    --gov-gold: #d6a432;
}

.gov-ribbon {
    background: var(--gov-navy);
    color: #fff;
    font-size: 12px;
    border-bottom: 3px solid var(--gov-gold);
}
.gov-ribbon-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 7px 22px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-weight: 700;
    letter-spacing: .01em;
}
.topbar {
    background: #fff;
    backdrop-filter: none;
}
.brand-mark {
    border-radius: 9px;
    background: var(--gov-blue);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.brand-title {
    color: #0f172a;
}
.topnav a {
    border-radius: 6px;
}
.topnav a:hover {
    background: #eef5ff;
    color: var(--gov-blue);
}

.gov-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 26px;
    align-items: stretch;
    margin-bottom: 26px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}
.gov-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    background: linear-gradient(180deg, var(--gov-blue), var(--gov-gold));
}
.gov-hero-content {
    padding: 34px 34px 34px 42px;
}
.gov-hero h1 {
    margin: 0 0 12px;
    font-size: 31px;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: #101828;
    max-width: 830px;
}
.gov-hero p {
    margin: 0;
    color: var(--muted);
    max-width: 820px;
    font-size: 15px;
}
.gov-hero-panel {
    background: linear-gradient(135deg, #f5f9ff, #ffffff);
    border-left: 1px solid var(--line);
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: center;
}
.gov-stat-card {
    border: 1px solid #d7e6f7;
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.gov-stat-card strong {
    display: block;
    color: var(--gov-blue);
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
    overflow-wrap: anywhere;
}
.gov-stat-card span {
    color: #475569;
    font-weight: 800;
    margin-top: 8px;
    font-size: 13px;
}
.gov-stat-card-wide {
    grid-column: 1 / -1;
}
.gov-stat-card-wide strong {
    font-size: 30px;
}
.card-official {
    border-top: 4px solid var(--gov-blue);
}
.gov-info-grid .info-card {
    border-top: 3px solid #d7e6f7;
}

.protocol-query-card-wide {
    width: 100%;
    padding: 30px;
}
.protocol-query-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
    gap: 30px;
    align-items: start;
}
.protocol-query-info h2 {
    margin: 0 0 10px;
    font-size: 24px;
}
.protocol-query-info p {
    color: var(--muted);
    margin: 0;
    max-width: 620px;
}
.protocol-query-form {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 16px;
    padding: 22px;
}
.consulta-title {
    margin-top: 2px;
}

.data-table-tools {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 12px;
    flex-wrap: wrap;
}
.data-table-tools-left,
.data-table-tools-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.data-table-search-wrap {
    min-width: min(420px, 100%);
}
.data-table-search-wrap label,
.data-table-page-size-wrap label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 5px;
}
.data-table-search {
    min-width: min(420px, 100%);
}
.data-table-page-size {
    width: 105px;
}
.data-table-info {
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}
.data-table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.data-table-pagination .btn {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 13px;
}
.data-table-page-label {
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
    padding: 0 4px;
}
.data-table-row-hidden,
.data-table-page-hidden {
    display: none !important;
}
.data-table-empty-filter td {
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}
.data-table-enhanced {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.data-table-enhanced .data-table {
    border-collapse: separate;
    border-spacing: 0;
}
.data-table-enhanced thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

@media (max-width: 980px) {
    .gov-hero,
    .protocol-query-layout {
        grid-template-columns: 1fr;
    }
    .gov-hero-panel {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}
@media (max-width: 720px) {
    .gov-ribbon-inner,
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .topnav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .gov-hero h1 {
        font-size: 24px;
    }
    .gov-hero-panel {
        grid-template-columns: 1fr;
    }
    .protocol-query-form {
        padding: 16px;
    }
    .data-table-tools,
    .data-table-tools-left,
    .data-table-tools-right,
    .data-table-pagination {
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
    }
    .data-table-search,
    .data-table-search-wrap,
    .data-table-page-size-wrap,
    .data-table-page-size {
        width: 100%;
    }
}


/* v19 - Tela inicial refinada | espaçamentos, largura e disposição */

.main,
.topbar-inner,
.gov-ribbon-inner,
.footer {
    max-width: 1500px;
}

.main {
    padding: 24px 22px 38px;
}

.gov-ribbon-inner {
    padding-top: 6px;
    padding-bottom: 6px;
}

.topbar-inner {
    padding-top: 14px;
    padding-bottom: 14px;
}

.gov-hero {
    grid-template-columns: 1fr;
    margin-bottom: 20px;
    border-radius: 18px;
}

.gov-hero-content {
    padding: 28px 36px 28px 44px;
}

.gov-hero h1 {
    max-width: 1080px;
    font-size: clamp(28px, 2.45vw, 42px);
    line-height: 1.12;
    margin-bottom: 12px;
}

.gov-hero p {
    max-width: 980px;
    font-size: 15px;
    line-height: 1.55;
}

.gov-hero .eyebrow,
.eyebrow {
    margin-bottom: 10px;
    font-size: 12px;
}

.home-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.home-select-card,
.home-kpi-card,
.manual-card {
    background: var(--surface);
    border: 1px solid #cfe0f2;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.065);
}

.home-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    margin-bottom: 0;
}

.home-kpi-card {
    min-height: 136px;
    padding: 18px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.home-icon-circle,
.manual-book,
.home-kpi-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #e8f2ff;
    color: var(--primary);
    font-size: 21px;
}

.home-kpi-card strong {
    display: block;
    width: 100%;
    margin-top: 10px;
    color: var(--primary);
    font-size: clamp(28px, 2.6vw, 38px);
    line-height: 1.04;
    font-weight: 900;
    white-space: normal;
    overflow-wrap: anywhere;
    letter-spacing: -0.02em;
}

.home-kpi-card:nth-child(3) strong {
    font-size: clamp(25px, 2.15vw, 34px);
    letter-spacing: -0.04em;
}

.home-kpi-card span:not(.home-kpi-icon) {
    display: block;
    margin-top: 8px;
    color: #071f52;
    font-size: 14px;
    font-weight: 900;
}

.home-kpi-card small {
    display: block;
    margin-top: 2px;
    color: #536a89;
    font-size: 12px;
}

.home-select-card {
    padding: 24px 28px;
    border-top: 5px solid var(--primary);
}

.home-card-title {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.home-card-title h1 {
    margin: 0 0 5px;
    font-size: 25px;
    line-height: 1.15;
    color: #071f52;
}

.home-card-title p,
.manual-header p,
.manual-step-card p,
.home-kpi-card small {
    margin: 0;
    color: #536a89;
}

.home-selector-form label {
    color: #071f52;
    font-size: 14px;
}

.home-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 14px;
    align-items: end;
}

.home-input-row .input,
.home-input-row .btn {
    min-height: 50px;
}

.home-input-row .btn {
    white-space: nowrap;
}

.manual-card {
    padding: 24px 24px 20px;
    margin-bottom: 22px;
}

.manual-header {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.manual-header h2 {
    margin: 0 0 4px;
    font-size: 25px;
    line-height: 1.15;
    color: #071f52;
}

.manual-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 26px 16px;
    align-items: stretch;
    position: relative;
}

.manual-step-card {
    position: relative;
    border: 1px solid #d6e4f3;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 34px 16px 16px;
    text-align: center;
    min-height: 252px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.manual-step-number {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 8px 16px rgba(22, 91, 170, .22);
}

.manual-step-image {
    width: 100%;
    max-width: 142px;
    height: 86px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}

.manual-step-card h3 {
    margin: 0 0 8px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #071f52;
    font-size: 15.5px;
    line-height: 1.18;
}

.manual-step-card p {
    font-size: 13.2px;
    line-height: 1.36;
}

.manual-arrow {
    display: none;
}

.manual-important {
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: linear-gradient(90deg, #eef7ff, #f8fbff);
    color: #164b83;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.manual-important span {
    color: var(--primary);
    font-weight: 900;
    font-size: 18px;
}

.manual-important p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.footer {
    padding-top: 22px;
    padding-bottom: 28px;
}

@media (min-width: 1280px) {
    .manual-flow {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 18px 14px;
    }

    .manual-step-card {
        min-height: 258px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .manual-step-image {
        max-width: 136px;
        height: 88px;
    }
}

@media (max-width: 1180px) {
    .main,
    .topbar-inner,
    .gov-ribbon-inner,
    .footer {
        max-width: 100%;
    }

    .manual-flow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .main {
        padding: 20px 16px 34px;
    }

    .gov-hero-content {
        padding: 24px 24px 24px 32px;
    }

    .home-kpi-grid,
    .manual-flow {
        grid-template-columns: 1fr;
    }

    .home-input-row {
        grid-template-columns: 1fr;
    }

    .home-input-row .btn {
        width: 100%;
    }

    .manual-step-card {
        min-height: auto;
    }

    .manual-step-card h3 {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .gov-hero h1 {
        font-size: 24px;
    }

    .home-select-card,
    .manual-card {
        padding: 20px 16px;
    }

    .home-card-title,
    .manual-header {
        align-items: flex-start;
    }
}

/* Ajuste v18 - Página inicial em duas colunas: seleção do município + consulta de protocolo */
.home-two-columns{
    display:grid;
    grid-template-columns:minmax(0, 2fr) minmax(320px, 1fr);
    gap:24px;
    align-items:stretch;
}

.home-two-columns .home-select-card,
.home-two-columns .home-action-card{
    height:100%;
}

.home-two-columns .home-select-card{
    margin:0;
}

.protocol-card{
    min-height:204px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:flex-start;
    gap:18px;
    padding:30px 32px;
    text-decoration:none;
}

.protocol-card .home-action-icon{
    width:48px;
    height:48px;
    font-size:24px;
    flex:0 0 auto;
}

.protocol-card strong{
    display:block;
    font-size:22px;
    line-height:1.2;
    margin:0 0 10px;
}

.protocol-card p{
    margin:0;
    font-size:15px;
    line-height:1.55;
}

@media (max-width: 1100px){
    .home-two-columns{
        grid-template-columns:1fr;
    }

    .protocol-card{
        min-height:auto;
    }
}

/* v18.1 - Refinamento visual da home + prazo final de envio */
:root{
    --gov-blue:#0b3d70;
    --gov-blue-2:#155da7;
    --gov-gold:#d6a51e;
    --surface:#ffffff;
    --surface-soft:#f7faff;
    --line:#cfe0f3;
    --muted-text:#526783;
    --shadow-soft:0 18px 44px rgba(13, 55, 98, .10);
    --shadow-card:0 10px 26px rgba(13, 55, 98, .08);
}

body{
    background:
        radial-gradient(circle at top left, rgba(21,93,167,.08), transparent 32rem),
        linear-gradient(180deg, #f4f8fd 0%, #eef4fb 100%);
}

.main{
    max-width:1440px;
    padding-top:28px;
}

.gov-hero{
    margin-bottom:18px;
}

.gov-hero-content{
    position:relative;
    overflow:hidden;
    border:1px solid var(--line);
    border-left:7px solid var(--gov-blue-2);
    border-radius:18px;
    box-shadow:var(--shadow-soft);
    background:
        linear-gradient(120deg, rgba(255,255,255,.98), rgba(255,255,255,.94)),
        radial-gradient(circle at right top, rgba(21,93,167,.13), transparent 22rem);
    padding:34px 42px 30px;
}

.gov-hero-content::after{
    content:"";
    position:absolute;
    right:-96px;
    top:-110px;
    width:280px;
    height:280px;
    border-radius:999px;
    background:rgba(214,165,30,.10);
}

.gov-hero .eyebrow,
.manual-page-hero .eyebrow{
    color:var(--gov-blue-2);
    letter-spacing:.10em;
    font-weight:900;
}

.gov-hero h1{
    max-width:1040px;
    font-size:clamp(31px, 3vw, 46px);
    line-height:1.04;
    margin-bottom:18px;
    letter-spacing:-.035em;
}

.gov-hero p{
    max-width:980px;
    color:var(--muted-text);
    font-size:16px;
    line-height:1.6;
}

.hero-action-row{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:24px;
}

.hero-action-row .btn{
    min-height:46px;
    padding-left:20px;
    padding-right:20px;
}

.deadline-banner{
    display:flex;
    align-items:center;
    gap:16px;
    margin:0 0 20px;
    padding:18px 22px;
    border-radius:16px;
    border:1px solid var(--line);
    box-shadow:var(--shadow-card);
    background:#fff;
}

.deadline-banner.is-open{
    border-left:6px solid #168253;
}

.deadline-banner.is-closed{
    border-left:6px solid #b42318;
    background:#fff8f7;
}

.deadline-icon{
    width:44px;
    height:44px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#eaf3ff;
    color:var(--gov-blue-2);
    font-size:22px;
    flex:0 0 auto;
}

.deadline-banner strong{
    display:block;
    font-size:16px;
    color:#051b3a;
    margin-bottom:4px;
}

.deadline-banner p{
    margin:0;
    color:var(--muted-text);
    line-height:1.45;
}

.home-dashboard{
    margin-bottom:18px;
}

.home-kpi-grid{
    gap:20px;
}

.home-kpi-card{
    min-height:132px;
    border:1px solid var(--line);
    border-radius:18px;
    box-shadow:var(--shadow-card);
    background:
        linear-gradient(180deg, #fff 0%, #fbfdff 100%);
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-kpi-card:hover{
    transform:translateY(-2px);
    box-shadow:0 16px 34px rgba(13, 55, 98, .12);
    border-color:#a9c6e8;
}

.home-kpi-icon,
.home-icon-circle,
.home-action-icon,
.manual-book{
    background:#eaf3ff;
    color:var(--gov-blue-2);
}

.home-kpi-card strong{
    color:var(--gov-blue-2);
    font-size:34px;
    letter-spacing:-.03em;
}

.home-kpi-card span{
    color:#061d40;
    font-weight:900;
}

.home-kpi-card small{
    color:var(--muted-text);
}

.home-two-columns{
    grid-template-columns:minmax(0, 2.15fr) minmax(330px, .95fr);
    gap:22px;
}

.home-select-card,
.protocol-card,
.manual-card,
.manual-page-hero,
.manual-info-card{
    border:1px solid var(--line);
    border-radius:18px;
    box-shadow:var(--shadow-card);
    background:#fff;
}

.home-select-card{
    border-top:6px solid var(--gov-blue-2);
    padding:28px 30px;
}

.home-card-title h1{
    font-size:28px;
    letter-spacing:-.02em;
}

.home-card-title p{
    font-size:15px;
    color:var(--muted-text);
}

.home-selector-form label{
    color:#061d40;
    font-weight:900;
}

.home-input-row{
    grid-template-columns:minmax(0, 1fr) 210px;
    gap:14px;
}

.input,
select.input{
    min-height:52px;
    border-color:#bdd2ea;
    border-radius:12px;
    font-size:15px;
}

.input:focus,
select.input:focus{
    outline:none;
    border-color:var(--gov-blue-2);
    box-shadow:0 0 0 4px rgba(21,93,167,.13);
}

.btn-primary{
    background:linear-gradient(180deg, #1d66b4 0%, #155da7 100%);
    border-color:#155da7;
    box-shadow:0 8px 18px rgba(21,93,167,.20);
}

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

.btn-secondary{
    background:#f4f8fd;
    border-color:#cfe0f3;
    color:#0b3d70;
}

.protocol-card{
    position:relative;
    overflow:hidden;
    min-height:100%;
    color:#fff;
    background:
        linear-gradient(135deg, #0b3d70 0%, #155da7 100%);
    border-color:#155da7;
    box-shadow:0 18px 40px rgba(21, 93, 167, .22);
}

.protocol-card::after{
    content:"";
    position:absolute;
    right:-58px;
    top:-58px;
    width:170px;
    height:170px;
    border-radius:999px;
    background:rgba(255,255,255,.12);
}

.protocol-card .home-action-icon{
    background:rgba(255,255,255,.15);
    color:#fff;
    border:1px solid rgba(255,255,255,.20);
}

.protocol-card strong,
.protocol-card p{
    color:#fff;
}

.protocol-card p{
    opacity:.92;
}

.protocol-card-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    margin-top:20px;
    padding:0 15px;
    border-radius:999px;
    background:rgba(255,255,255,.16);
    border:1px solid rgba(255,255,255,.24);
    color:#fff;
    font-weight:900;
    font-size:13px;
}

.deadline-form-alert{
    margin:18px 0;
}

.manual-page-hero{
    background:linear-gradient(180deg, #f7fbff, #fff);
    padding:26px 30px;
    margin-top:28px;
}

.manual-page-hero h3{
    margin-top:10px;
    font-size:24px;
    letter-spacing:-.02em;
}

.manual-page-hero p{
    color:var(--muted-text);
    max-width:900px;
    line-height:1.6;
}

.manual-card{
    padding:28px 30px;
}

.manual-header h2{
    font-size:26px;
}

.manual-header p{
    color:var(--muted-text);
}

.manual-flow.manual-flow-page{
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:18px;
}

.manual-step-card{
    border:1px solid var(--line);
    border-radius:16px;
    background:#fff;
    box-shadow:none;
    min-height:286px;
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.manual-step-card:hover{
    transform:translateY(-2px);
    border-color:#a9c6e8;
    box-shadow:var(--shadow-card);
}

.manual-step-number{
    background:var(--gov-blue-2);
    box-shadow:0 8px 18px rgba(21,93,167,.22);
}

.manual-step-image{
    height:92px;
    max-width:128px;
}

.manual-step-card h3{
    color:#061d40;
    min-height:42px;
}

.manual-step-card p{
    color:var(--muted-text);
    font-size:13px;
    line-height:1.55;
}

.manual-info-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:18px;
    margin-top:24px;
}

.manual-info-card{
    padding:22px 24px;
}

.manual-info-card h2{
    margin:0 0 12px;
    font-size:19px;
    color:#061d40;
}

.manual-info-card ul{
    margin:0;
    padding-left:20px;
    color:var(--muted-text);
    line-height:1.7;
}

.manual-important{
    margin-top:22px;
    border-radius:14px;
    background:#edf6ff;
    border:1px solid #bddbff;
}

.footer{
    max-width:1440px;
    color:#526783;
}

@media (max-width: 1180px){
    .manual-flow.manual-flow-page{
        grid-template-columns:repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px){
    .home-two-columns,
    .home-input-row,
    .manual-info-grid{
        grid-template-columns:1fr;
    }

    .protocol-card{
        min-height:210px;
    }

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

@media (max-width: 640px){
    .gov-hero-content,
    .home-select-card,
    .manual-card,
    .manual-page-hero{
        padding:22px 18px;
    }

    .hero-action-row .btn,
    .home-input-row .btn{
        width:100%;
    }

    .manual-flow.manual-flow-page{
        grid-template-columns:1fr;
    }
}

/* Ajustes do Painel SES - dashboard administrativo */
.admin-dashboard-title{
    align-items:center;
}

.admin-title-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.admin-dashboard-summary{
    grid-template-columns:repeat(5, minmax(0, 1fr));
}

.admin-progress-card{
    border-top:4px solid var(--primary, #155da7);
}

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

.admin-progress-item{
    border:1px solid var(--line, #d7e4f3);
    border-radius:16px;
    padding:18px;
    background:#f8fbff;
}

.admin-progress-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:12px;
}

.admin-progress-top strong{
    font-size:18px;
    color:#061d40;
}

.admin-progress-top span{
    font-size:24px;
    font-weight:900;
    color:var(--primary, #155da7);
}

.admin-progress-bar{
    height:14px;
    border-radius:999px;
    background:#dce8f6;
    overflow:hidden;
}

.admin-progress-bar i{
    display:block;
    height:100%;
    border-radius:999px;
    background:linear-gradient(90deg, #155da7, #2f80d4);
}

.admin-progress-bar.payment i{
    background:linear-gradient(90deg, #0f766e, #14b8a6);
}

.admin-progress-item p{
    margin:10px 0 0;
    color:var(--muted, #526783);
    font-weight:700;
}

.admin-status-grid{
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:14px;
    margin-bottom:22px;
}

.admin-status-card{
    background:#fff;
    border:1px solid var(--line, #d7e4f3);
    border-radius:18px;
    padding:18px;
    box-shadow:var(--shadow, 0 16px 32px rgba(15,39,75,.08));
    border-top:5px solid #155da7;
}

.admin-status-main span{
    display:block;
    color:var(--muted, #526783);
    font-weight:900;
    text-transform:uppercase;
    font-size:12px;
    letter-spacing:.04em;
}

.admin-status-main strong{
    display:block;
    margin-top:8px;
    color:#061d40;
    font-size:34px;
    line-height:1;
}

.admin-status-meta{
    margin-top:14px;
    display:grid;
    gap:6px;
}

.admin-status-meta span,
.admin-status-meta small{
    color:var(--muted, #526783);
    font-weight:700;
}

.admin-status-meta b{
    color:#061d40;
    font-size:18px;
}

.admin-status-card.status-aprovado{ border-top-color:#15803d; }
.admin-status-card.status-reprovado{ border-top-color:#b91c1c; }
.admin-status-card.status-pago{ border-top-color:#0f766e; }
.admin-status-card.status-cancelado{ border-top-color:#64748b; }
.admin-status-card.status-enviado{ border-top-color:#155da7; }

@media (max-width: 1180px){
    .admin-dashboard-summary,
    .admin-status-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px){
    .admin-dashboard-title{
        align-items:flex-start;
    }
    .admin-title-actions,
    .admin-progress-grid,
    .admin-dashboard-summary,
    .admin-status-grid{
        grid-template-columns:1fr;
    }
    .admin-title-actions{
        justify-content:flex-start;
    }
}


/* v20 - Fluxo visual de acompanhamento na consulta de protocolo */
.status-flow-card { margin-top: 18px; }
.status-flow { display: grid; grid-template-columns: 1fr 90px 1fr 90px 1fr; align-items: start; gap: 0; padding: 18px 8px 10px; }
.status-step { text-align: center; position: relative; min-width: 0; }
.status-marker { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; border: 2px solid #b9c4d0; background: #fff; color: #64748b; }
.status-step.done .status-marker { background: #1f5b86; border-color: #1f5b86; color: #fff; }
.status-step.current .status-marker { box-shadow: 0 0 0 5px rgba(31,91,134,.14); }
.status-step.exception .status-marker { background: #8a1f1f; border-color: #8a1f1f; color: #fff; }
.status-step.disabled .status-marker { background: #f3f4f6; border-color: #d1d5db; color: #9ca3af; }
.status-title { font-weight: 800; color: #1f2937; text-transform: uppercase; font-size: .92rem; letter-spacing: .02em; }
.status-caption { color: #64748b; font-size: .82rem; margin-top: 4px; line-height: 1.25; }
.status-step.disabled .status-title, .status-step.disabled .status-caption { color: #9ca3af; }
.status-connector { height: 3px; background: #d7dee8; margin-top: 20px; }
.status-connector.active { background: #1f5b86; }
.status-connector.disabled { background: repeating-linear-gradient(90deg, #d1d5db 0, #d1d5db 8px, transparent 8px, transparent 14px); }
.status-flow-help { margin-top: 12px; padding: 12px 14px; border-left: 4px solid #1f5b86; background: #f4f8fb; color: #334155; border-radius: 8px; font-size: .94rem; }
@media (max-width: 760px) { .status-flow { grid-template-columns: 1fr; row-gap: 10px; } .status-connector { width: 3px; height: 26px; margin: 0 auto; } }

/* v22 - Fluxo horizontal da consulta de protocolo */
.ep-flow-card{
    margin-top:18px;
    padding:28px 32px 30px;
    border:1px solid rgba(31,91,134,.16);
    background:#fff;
    box-shadow:0 14px 36px rgba(15,23,42,.06);
}
.ep-flow-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:28px;
}
.ep-flow-header h2{ margin-bottom:6px; }
.ep-flow-header p{ margin:0; color:#53657d; }
.ep-flow-badge{
    flex:0 0 auto;
    padding:8px 12px;
    border-radius:999px;
    background:#eef6ff;
    border:1px solid #c9def5;
    color:#1f5b86;
    font-size:.82rem;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.02em;
}
.ep-flow-tracker{
    display:grid;
    grid-template-columns:minmax(150px,1fr) minmax(90px,160px) minmax(150px,1fr) minmax(90px,160px) minmax(150px,1fr);
    align-items:start;
    gap:0;
    padding:4px 12px 0;
}
.ep-flow-stage{
    min-width:0;
    text-align:center;
    position:relative;
    color:#1f2a3d;
}
.ep-flow-title{
    min-height:38px;
    display:flex;
    align-items:flex-end;
    justify-content:center;
    padding:0 6px 3px;
    font-size:.93rem;
    font-weight:900;
    line-height:1.12;
    color:#475569;
}
.ep-flow-subtitle{
    min-height:34px;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:0 8px;
    font-size:.78rem;
    line-height:1.15;
    color:#64748b;
}
.ep-flow-node{
    width:54px;
    height:54px;
    margin:10px auto 10px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
    z-index:2;
    background:#cbd5e1;
    color:#fff;
    box-shadow:0 0 0 6px #fff;
}
.ep-flow-node svg{
    width:26px;
    height:26px;
    fill:currentColor;
}
.ep-flow-node span{
    position:absolute;
    right:-4px;
    bottom:-4px;
    width:22px;
    height:22px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    border:3px solid #fff;
    background:#94a3b8;
    color:#fff;
    font-size:.76rem;
    font-weight:900;
    line-height:1;
}
.ep-flow-date{
    min-height:32px;
    padding:0 8px;
    color:#64748b;
    font-size:.82rem;
    line-height:1.25;
}
.ep-flow-tag{
    display:inline-flex;
    justify-content:center;
    min-width:96px;
    margin-top:10px;
    padding:5px 12px;
    border-radius:4px;
    background:#94a3b8;
    color:#fff;
    font-size:.78rem;
    font-weight:900;
    text-transform:lowercase;
}
.ep-flow-track-line{
    height:4px;
    margin-top:92px;
    background:#cbd5e1;
    position:relative;
    z-index:1;
}
.ep-flow-track-line::after{
    content:"";
    position:absolute;
    right:-7px;
    top:50%;
    width:0;
    height:0;
    transform:translateY(-50%);
    border-left:9px solid #cbd5e1;
    border-top:6px solid transparent;
    border-bottom:6px solid transparent;
}
.ep-flow-stage.complete .ep-flow-node{
    background:#22b52e;
}
.ep-flow-stage.complete .ep-flow-node span{
    background:#168a22;
}
.ep-flow-stage.complete .ep-flow-tag{
    background:#22b52e;
}
.ep-flow-stage.complete .ep-flow-title{
    color:#334155;
}
.ep-flow-stage.pending .ep-flow-node{
    background:#ffc107;
    color:#fff;
}
.ep-flow-stage.pending .ep-flow-node span{
    display:none;
}
.ep-flow-stage.pending .ep-flow-tag{
    background:#ffc107;
    color:#5f4200;
}
.ep-flow-stage.exception .ep-flow-node{
    background:#dc3545;
}
.ep-flow-stage.exception .ep-flow-node span{
    background:#b42318;
}
.ep-flow-stage.exception .ep-flow-tag{
    background:#dc3545;
}
.ep-flow-stage.disabled{
    opacity:.78;
}
.ep-flow-stage.disabled .ep-flow-node{
    background:#8f98a3;
}
.ep-flow-stage.disabled .ep-flow-node span{
    background:#737b85;
}
.ep-flow-stage.disabled .ep-flow-tag{
    background:#8f98a3;
}
.ep-flow-stage.current .ep-flow-node{
    box-shadow:0 0 0 6px #fff, 0 0 0 10px rgba(31,91,134,.14);
}
.ep-flow-track-line.complete,
.ep-flow-track-line.complete::after{
    background:#22b52e;
    border-left-color:#22b52e;
}
.ep-flow-track-line.pending,
.ep-flow-track-line.pending::after{
    background:#ffc107;
    border-left-color:#ffc107;
}
.ep-flow-track-line.disabled{
    background:repeating-linear-gradient(90deg,#cbd5e1 0,#cbd5e1 10px,transparent 10px,transparent 18px);
}
.ep-flow-track-line.disabled::after{
    border-left-color:#cbd5e1;
}
.ep-flow-help{
    margin-top:24px;
    padding:13px 15px;
    border-radius:10px;
    background:#f4f8fb;
    border-left:4px solid #1f5b86;
    color:#334155;
    font-weight:650;
    line-height:1.45;
}
@media (max-width: 900px){
    .ep-flow-card{ padding:24px 18px; }
    .ep-flow-header{ flex-direction:column; margin-bottom:20px; }
    .ep-flow-tracker{
        grid-template-columns:1fr;
        padding:0;
        gap:0;
    }
    .ep-flow-stage{
        display:grid;
        grid-template-columns:62px 1fr auto;
        grid-template-areas:
            "node title tag"
            "node subtitle tag"
            "node date tag";
        align-items:center;
        column-gap:12px;
        text-align:left;
        padding:8px 0;
    }
    .ep-flow-title{
        grid-area:title;
        min-height:auto;
        align-items:center;
        justify-content:flex-start;
        padding:0;
    }
    .ep-flow-subtitle{
        grid-area:subtitle;
        min-height:auto;
        justify-content:flex-start;
        padding:2px 0;
    }
    .ep-flow-node{
        grid-area:node;
        width:48px;
        height:48px;
        margin:0 auto;
    }
    .ep-flow-date{
        grid-area:date;
        min-height:auto;
        padding:0;
    }
    .ep-flow-tag{
        grid-area:tag;
        min-width:86px;
        margin-top:0;
    }
    .ep-flow-track-line{
        width:4px;
        height:28px;
        margin:0 0 0 29px;
    }
    .ep-flow-track-line::after{
        right:auto;
        left:50%;
        top:auto;
        bottom:-7px;
        transform:translateX(-50%);
        border-left:6px solid transparent;
        border-right:6px solid transparent;
        border-top:9px solid #cbd5e1;
        border-bottom:0;
    }
    .ep-flow-track-line.complete::after{ border-top-color:#22b52e; border-left-color:transparent; }
    .ep-flow-track-line.pending::after{ border-top-color:#ffc107; border-left-color:transparent; }
    .ep-flow-track-line.disabled::after{ border-top-color:#cbd5e1; border-left-color:transparent; }
}

/* v23 - Correção do fluxo de protocolo: marcadores sem SVG/imagem */
.ep-flow-card{
    margin-top:18px;
    padding:26px 30px 28px;
    border:1px solid rgba(31,91,134,.16);
    background:#fff;
    box-shadow:0 14px 36px rgba(15,23,42,.06);
}
.ep-flow-tracker{
    display:grid;
    grid-template-columns:minmax(145px,1fr) minmax(80px,150px) minmax(145px,1fr) minmax(80px,150px) minmax(145px,1fr);
    align-items:start;
    gap:0;
    padding:4px 10px 0;
}
.ep-flow-stage{
    min-width:0;
    text-align:center;
    position:relative;
}
.ep-flow-title{
    min-height:34px;
    display:flex;
    align-items:flex-end;
    justify-content:center;
    padding:0 6px 4px;
    font-size:.92rem;
    font-weight:900;
    line-height:1.12;
    color:#475569;
}
.ep-flow-subtitle{
    min-height:32px;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:0 8px;
    font-size:.77rem;
    line-height:1.15;
    color:#64748b;
}
.ep-flow-node{
    width:48px !important;
    height:48px !important;
    min-width:48px;
    min-height:48px;
    max-width:48px;
    max-height:48px;
    margin:10px auto 9px !important;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
    z-index:2;
    background:#cbd5e1;
    color:#fff;
    box-shadow:0 0 0 6px #fff;
    overflow:hidden;
}
.ep-flow-node svg{ display:none !important; }
.ep-flow-node span{
    position:static !important;
    inset:auto !important;
    width:auto !important;
    height:auto !important;
    min-width:0 !important;
    min-height:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    color:inherit !important;
    display:flex !important;
    align-items:center;
    justify-content:center;
    font-size:1.45rem !important;
    font-weight:900;
    line-height:1 !important;
}
.ep-flow-date{
    min-height:30px;
    padding:0 8px;
    color:#64748b;
    font-size:.8rem;
    line-height:1.22;
}
.ep-flow-tag{
    display:inline-flex;
    justify-content:center;
    min-width:92px;
    margin-top:9px;
    padding:5px 11px;
    border-radius:4px;
    background:#94a3b8;
    color:#fff;
    font-size:.77rem;
    font-weight:900;
    text-transform:lowercase;
}
.ep-flow-track-line{
    height:4px;
    margin-top:88px;
    background:#cbd5e1;
    position:relative;
    z-index:1;
}
.ep-flow-stage.complete .ep-flow-node,
.ep-flow-stage.complete .ep-flow-tag{
    background:#22b52e;
}
.ep-flow-stage.pending .ep-flow-node,
.ep-flow-stage.pending .ep-flow-tag{
    background:#ffc107;
    color:#5f4200;
}
.ep-flow-stage.exception .ep-flow-node,
.ep-flow-stage.exception .ep-flow-tag{
    background:#dc3545;
    color:#fff;
}
.ep-flow-stage.disabled .ep-flow-node,
.ep-flow-stage.disabled .ep-flow-tag{
    background:#8f98a3;
    color:#fff;
}
.ep-flow-track-line.complete,
.ep-flow-track-line.complete::after{
    background:#22b52e;
    border-left-color:#22b52e;
}
.ep-flow-track-line.pending,
.ep-flow-track-line.pending::after{
    background:#ffc107;
    border-left-color:#ffc107;
}
.ep-flow-track-line.disabled{
    background:repeating-linear-gradient(90deg,#cbd5e1 0,#cbd5e1 10px,transparent 10px,transparent 18px);
}
.ep-flow-track-line.disabled::after{
    border-left-color:#cbd5e1;
}
@media (max-width:900px){
    .ep-flow-tracker{ grid-template-columns:1fr; padding:0; }
    .ep-flow-stage{
        display:grid;
        grid-template-columns:58px 1fr auto;
        grid-template-areas:"node title tag" "node subtitle tag" "node date tag";
        column-gap:12px;
        text-align:left;
        align-items:center;
        padding:8px 0;
    }
    .ep-flow-node{ grid-area:node; width:44px !important; height:44px !important; min-width:44px; min-height:44px; max-width:44px; max-height:44px; margin:0 auto !important; }
    .ep-flow-node span{ font-size:1.3rem !important; }
    .ep-flow-title{ grid-area:title; min-height:auto; justify-content:flex-start; padding:0; }
    .ep-flow-subtitle{ grid-area:subtitle; min-height:auto; justify-content:flex-start; padding:2px 0; }
    .ep-flow-date{ grid-area:date; min-height:auto; padding:0; }
    .ep-flow-tag{ grid-area:tag; min-width:84px; margin-top:0; }
    .ep-flow-track-line{ width:4px; height:28px; margin:0 0 0 27px; }
}

/* v24 - Fluxo de protocolo horizontal no padrão rastreamento */
.ep-flow-card{
    margin-top:18px !important;
    padding:26px 30px 28px !important;
    border:1px solid rgba(31,91,134,.18) !important;
    background:#fff !important;
    box-shadow:0 14px 36px rgba(15,23,42,.06) !important;
    overflow:hidden !important;
}
.ep-flow-header{
    display:flex !important;
    align-items:flex-start !important;
    justify-content:space-between !important;
    gap:18px !important;
    margin-bottom:18px !important;
}
.ep-flow-header h2{ margin:0 0 6px !important; }
.ep-flow-header p{ margin:0 !important; color:#64748b !important; }
.ep-flow-badge{
    display:inline-flex !important;
    align-items:center !important;
    white-space:nowrap !important;
    padding:7px 12px !important;
    border-radius:999px !important;
    background:#eef6ff !important;
    color:#15538a !important;
    font-size:.78rem !important;
    font-weight:800 !important;
    border:1px solid #cfe4ff !important;
}
.ep-flow-tracker{
    display:grid !important;
    grid-template-columns:minmax(126px,1fr) minmax(66px,120px) minmax(126px,1fr) minmax(66px,120px) minmax(126px,1fr) !important;
    align-items:start !important;
    gap:0 !important;
    width:100% !important;
    padding:2px 0 0 !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
}
.ep-flow-stage{
    min-width:126px !important;
    text-align:center !important;
    position:relative !important;
    display:block !important;
    padding:0 !important;
}
.ep-flow-title{
    min-height:36px !important;
    height:36px !important;
    display:flex !important;
    align-items:flex-end !important;
    justify-content:center !important;
    padding:0 5px 5px !important;
    color:#64748b !important;
    font-size:.80rem !important;
    font-weight:900 !important;
    line-height:1.12 !important;
    text-transform:none !important;
}
.ep-flow-subtitle{
    min-height:32px !important;
    height:32px !important;
    display:flex !important;
    align-items:flex-start !important;
    justify-content:center !important;
    padding:0 6px !important;
    color:#64748b !important;
    font-size:.72rem !important;
    font-weight:600 !important;
    line-height:1.15 !important;
}
.ep-flow-node{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
    max-width:42px !important;
    max-height:42px !important;
    margin:8px auto 8px !important;
    border-radius:50% !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    position:relative !important;
    z-index:2 !important;
    background:#9ca3af !important;
    color:#fff !important;
    box-shadow:0 0 0 6px #fff !important;
    overflow:hidden !important;
    font-family:Arial, Helvetica, sans-serif !important;
}
.ep-flow-node span{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:auto !important;
    height:auto !important;
    background:transparent !important;
    border:0 !important;
    color:inherit !important;
    font-size:1.35rem !important;
    font-weight:900 !important;
    line-height:1 !important;
}
.ep-flow-date{
    min-height:34px !important;
    padding:0 5px !important;
    color:#64748b !important;
    font-size:.74rem !important;
    line-height:1.18 !important;
    white-space:normal !important;
}
.ep-flow-tag{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:86px !important;
    margin-top:8px !important;
    padding:5px 10px !important;
    border-radius:2px !important;
    background:#94a3b8 !important;
    color:#fff !important;
    font-size:.72rem !important;
    font-weight:900 !important;
    line-height:1 !important;
    text-transform:lowercase !important;
}
.ep-flow-track-line{
    height:4px !important;
    min-width:66px !important;
    margin-top:80px !important;
    background:#cbd5e1 !important;
    position:relative !important;
    z-index:1 !important;
    display:block !important;
}
.ep-flow-track-line::before,
.ep-flow-track-line::after{ content:none !important; display:none !important; }
.ep-flow-stage.complete .ep-flow-node,
.ep-flow-stage.complete .ep-flow-tag,
.ep-flow-track-line.complete{ background:#22b52e !important; color:#fff !important; }
.ep-flow-stage.pending .ep-flow-node,
.ep-flow-stage.pending .ep-flow-tag,
.ep-flow-track-line.pending{ background:#ffc107 !important; color:#5f4200 !important; }
.ep-flow-stage.exception .ep-flow-node,
.ep-flow-stage.exception .ep-flow-tag{ background:#dc3545 !important; color:#fff !important; }
.ep-flow-stage.disabled .ep-flow-node,
.ep-flow-stage.disabled .ep-flow-tag{ background:#8f98a3 !important; color:#fff !important; }
.ep-flow-track-line.disabled{ background:repeating-linear-gradient(90deg,#cbd5e1 0,#cbd5e1 10px,transparent 10px,transparent 18px) !important; }
.ep-flow-help{
    margin-top:18px !important;
    padding:10px 12px !important;
    border-radius:8px !important;
    background:#f8fafc !important;
    border:1px solid #e2e8f0 !important;
    color:#334155 !important;
    font-size:.88rem !important;
}
@media (max-width:560px){
    .ep-flow-card{ padding:22px 18px !important; }
    .ep-flow-header{ display:block !important; }
    .ep-flow-badge{ margin-top:10px !important; }
    .ep-flow-tracker{ min-width:640px !important; }
}

/* CRUD administrativo de emendas */
.form-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-grid label,
.admin-filter-form label,
.admin-emenda-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
}
.hero-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.admin-form-card { margin-bottom: 20px; }
.advanced-fields {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    background: var(--surface-soft);
    margin-top: 8px;
}
.advanced-fields summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 12px;
}
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.table-actions form { margin: 0; }
.btn-small {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
}
@media (max-width: 980px) {
    .form-grid-3,
    .form-grid-4,
    .form-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .form-grid-3,
    .form-grid-4,
    .form-grid-5 { grid-template-columns: 1fr; }
}
