:root{--gb-wine:#254d3c}body{background:#f5f6fa}.gb-list{display:flex;flex-direction:column;gap:20px}.gb-card{background:#fff;border:1px solid #e5e7ee;border-left:5px solid var(--gb-wine);border-radius:14px;padding:24px;box-shadow:0 4px 14px #25304708;scroll-margin-top:20px}.gb-card h2{font-size:22px;margin:8px 0;color:#253047}.gb-card p{line-height:1.6}.gb-kicker{font-size:12px;letter-spacing:.08em;color:var(--gb-wine);font-weight:700}.gb-toolbar,.gb-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.gb-actions{justify-content:flex-start;margin-top:18px}.gb-actions form{margin:0}.gb-actions button.selected{background:var(--gb-wine);color:white}.gb-status{padding:8px 12px;border-radius:8px;font-weight:600;font-size:13px;background:#dcfce7;color:#166534}.gb-status.vencido{background:#fee2e2;color:#991b1b}.gb-status.proximo{background:#fef3c7;color:#854d0e}.gb-card.vencido{border-left-color:#dc2626}.gb-card.proximo{border-left-color:#eab308}.gb-metrics{display:flex;flex-wrap:wrap;gap:24px;margin:18px 0}.gb-metrics>div{min-width:130px;flex:1}.gb-metrics small,.gb-metrics strong{display:block}.gb-metrics small{color:#687184;margin-bottom:5px}.gb-panel{border-top:1px solid #e5e7ee;margin-top:20px;padding-top:20px}.gb-panel .gb-card{padding:16px;box-shadow:none;margin-top:12px}.gb-panel details{margin:12px 0;padding:14px;background:#f8f9fc;border-radius:8px}.gb-panel summary{cursor:pointer;font-weight:600}.gb-search{display:flex;gap:14px;align-items:end;margin:20px 0}.gb-search label{flex:1}.gb-panel form{display:grid;gap:12px}.gb-panel form button{justify-self:start}#gc-menu summary{color:#fff;padding:12px;cursor:pointer;font-weight:600}#gc-menu details a{padding-left:35px}button,a.botao{border-radius:8px}.gb-panel[aria-busy=true]{opacity:.6;pointer-events:none}@media(max-width:650px){.gb-card{padding:16px}.gb-metrics{gap:14px}.gb-search{flex-wrap:wrap}.gb-actions button{flex:1}.gb-status{margin-top:8px}}

/* Área expandida: título próprio, fundo suave e registros separados. */
.gb-card > .gb-panel{border:1px solid #dfe3e8;border-radius:12px;margin-top:22px;padding:0;background:#f3f4f6;overflow:hidden}
.gb-panel .gb-fragment{padding:22px}
.gb-panel .gb-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 0 18px;margin:0 0 20px;border-bottom:1px solid #dfe3e8;background:transparent}
.gb-detail-label{display:block;font-size:11px;font-weight:700;letter-spacing:.07em;color:#687184;line-height:1.6}
.gb-panel .gb-detail-heading h3{font-size:23px;line-height:1.25;color:#254d3c;margin:5px 0 0;font-weight:700}
.gb-panel .gb-detail-close{flex-shrink:0;background:#fff;color:#254d3c;border:1px solid #c7d3bb}
.gb-panel-top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:16px;margin-bottom:18px}
.gb-panel-top > strong{color:#394355;font-size:14px;line-height:1.6}
.gb-panel-top label{font-size:12px;color:#687184;min-width:210px}
.gb-panel-top select{margin-top:6px;background:#fff}
.gb-panel .gb-metrics{gap:12px;margin:18px 0 22px}
.gb-panel .gb-metrics > div{background:#fff;border:1px solid #e5e7eb;border-radius:9px;padding:14px;min-width:135px}
.gb-panel .gb-row{display:block;background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:18px;margin:14px 0}
.gb-panel .gb-row > strong{display:block;color:#263449;line-height:1.5;font-size:16px}
.gb-panel .gb-row > small{display:block;margin-bottom:6px;color:#737d8c}
.gb-panel .gb-row p{margin:9px 0;color:#526071}
.gb-panel details{background:#fff;border:1px solid #e5e7eb;padding:16px;margin:14px 0}
.gb-panel .gb-row details{background:#f7f8fa}
.gb-panel summary{color:#254d3c;line-height:1.5}
.gb-panel details[open] > summary{padding-bottom:14px;margin-bottom:14px;border-bottom:1px solid #e5e7eb}
.gb-panel .grade-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.gb-panel .grade-form label{min-width:0;font-size:13px;color:#485469}
.gb-panel .grade-form input,.gb-panel .grade-form select,.gb-panel .grade-form textarea{width:100%;box-sizing:border-box;background:#fff;margin-top:6px}
.gb-panel .grade-form > div{grid-column:1/-1}
.gb-panel .gb-create{border-left:3px solid #aab2bf}
.gb-card > .gb-actions{padding-top:16px;border-top:1px solid #e5e7eb}
@media(max-width:650px){.gb-panel .gb-fragment{padding:15px}.gb-panel .gb-detail-heading h3{font-size:20px}.gb-panel .grade-form{grid-template-columns:1fr}.gb-panel-top label{width:100%;min-width:0}.gb-panel .gb-metrics > div{min-width:110px}.gb-panel .gb-detail-close{font-size:12px;padding:8px}}
/* Detalhes em modal: sobreposição, cabeçalho fixo e rolagem interna. */
body.gb-modal-open{overflow:hidden}
.gb-modal{width:min(1080px,calc(100vw - 40px));max-width:none;height:auto;max-height:calc(100dvh - 48px);padding:0;border:1px solid #dfe3e8;border-radius:16px;background:#f3f4f6;color:#253047;box-shadow:0 24px 80px #17203340;overflow:hidden}
.gb-modal[open]{display:flex;flex-direction:column}
.gb-modal::backdrop{background:rgba(25,32,45,.55)}
.gb-modal-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:22px 26px;background:#fff;border-bottom:1px solid #dfe3e8;flex-shrink:0}
.gb-modal-heading h2{margin:5px 0 0;font-size:24px;line-height:1.3;color:#253047}
.gb-modal-heading button{flex-shrink:0;background:#fff;color:#253047;border:1px solid #d1d5db}
.gb-modal .gb-modal-body{overflow-y:auto;overscroll-behavior:contain;margin:0;padding:0;border:0;min-height:100px;background:#f3f4f6}
.gb-modal .gb-detail-heading{display:none}
.gb-modal .gb-fragment{padding:24px}
.gb-modal-message{padding:24px;color:#687184}
.gb-modal-body > .aviso{margin:20px}
.gb-modal [aria-busy=true]{opacity:.65;pointer-events:none}
.gb-card > .gb-panel{display:none!important}
@media(max-width:650px){.gb-modal{width:calc(100vw - 16px);max-height:calc(100dvh - 20px);border-radius:12px}.gb-modal-heading{padding:16px;gap:10px}.gb-modal-heading h2{font-size:20px}.gb-modal-heading button{font-size:12px;padding:8px}.gb-modal .gb-fragment{padding:14px}}

/* Filtros e estado do contrato. */
.gb-filters{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0 8px}
.gb-filter{display:inline-flex;align-items:center;gap:10px;padding:11px 16px;border:1px solid #dce1e8;border-radius:999px;background:#fff;color:#344054;text-decoration:none;font-weight:600;font-size:14px}
.gb-filter span{padding:2px 8px;border-radius:999px;background:#e9edf2;font-size:12px}
.gb-filter.vencidos{color:#991b1b;background:#fff1f2;border-color:#fecaca}.gb-filter.proximos{color:#854d0e;background:#fffbeb;border-color:#fde68a}
.gb-filter.active{outline:2px solid #475569;outline-offset:2px}.gb-filter.vencidos.active{outline-color:#dc2626}.gb-filter.proximos.active{outline-color:#ca8a04}
.gb-filter-help{font-size:12px;color:#687184}
.gb-list > .gb-card.vencido{background:#fee2e2;border-color:#f5b6b6;border-left-color:#dc2626}
.gb-list > .gb-card.proximo{background:#fef3c7;border-color:#ebd982;border-left-color:#eab308}
.gb-list > .gb-card.arquivado{background:#f1f3f5;border-color:#d6dbe2;border-left-color:#94a3b8}
.gb-card.vencido > .gb-actions,.gb-card.proximo > .gb-actions{border-top-color:#00000012}
.gb-archive-form{margin-left:auto!important}.gb-archive-button{background:#fff;color:#475569;border:1px solid #b8c0cd}
@media(max-width:650px){.gb-archive-form{margin-left:0!important;width:100%}.gb-archive-button{width:100%}.gb-filter{padding:9px 12px}}

.gb-toolbar .gb-archive-top{margin:0!important;flex-shrink:0}.gb-toolbar .gb-archive-top .gb-archive-button{display:inline-flex;align-items:center;justify-content:center;background:#475569;color:#fff;border:1px solid #475569;padding:12px 18px;border-radius:9px;font-size:14px;font-weight:700;min-height:44px;cursor:pointer}.gb-toolbar .gb-archive-top .gb-archive-button:hover{background:#334155}.gb-toolbar .gb-archive-top .gb-archive-button:focus-visible{outline:3px solid #64748b;outline-offset:3px}@media(max-width:650px){.gb-toolbar .gb-archive-top{width:100%}}

.gb-items-toolbar,.gb-item-main{display:flex;align-items:center;justify-content:space-between;gap:18px}.gb-items-toolbar{margin:20px 0}.gb-items-toolbar h3{margin:0;font-size:18px}.gb-item-card{background:#fff;border:1px solid #e1e5eb;border-radius:10px;padding:18px;margin:12px 0}.gb-item-main>div:first-child{flex:1;min-width:0}.gb-item-card h4{font-size:17px;line-height:1.5;margin:5px 0;color:#263449;overflow-wrap:anywhere}.gb-item-card p{margin:7px 0 0;font-size:13px;line-height:1.7;color:#596579}.gb-item-kind{font-size:11px;color:#687184;font-weight:600}.gb-item-actions{display:flex;gap:8px;align-items:center;flex-shrink:0}.gb-panel .gb-item-actions form{display:block;margin:0}.gb-item-actions button{background:#fff;color:#334155;border:1px solid #cbd5e1}.gb-item-actions .gb-item-delete{color:#b91c1c;border-color:#fecaca}.gb-item-editor{padding:18px;margin:16px 0;background:#f8fafc;border:1px solid #dfe5ed;border-radius:9px}.gb-item-editor[hidden]{display:none!important}.gb-wide{grid-column:1/-1}.gb-confirm-items{margin-top:20px}.gb-contract-form{background:#fff;padding:20px;border:1px solid #e1e5eb;border-radius:10px}@media(max-width:650px){.gb-item-main{align-items:stretch;flex-direction:column}.gb-item-actions{justify-content:flex-end}.gb-items-toolbar{flex-wrap:wrap}}

/* Campos de entrada com contraste, mantendo a mesma aparência em todas as telas. */
body main input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),body main select,body main textarea,body .gb-modal .gb-panel input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),body .gb-modal .gb-panel select,body .gb-modal .gb-panel textarea{background:#eef0f3;color:#253047;border:1px solid #cbd2dc;border-radius:8px;min-height:42px;padding:10px 12px;box-sizing:border-box}
body main input:focus,body main select:focus,body main textarea:focus,body .gb-modal .gb-panel input:focus,body .gb-modal .gb-panel select:focus,body .gb-modal .gb-panel textarea:focus{background:#e8ecf2;outline:2px solid #8393ab;outline-offset:1px;border-color:#7b8ba3}
body input::placeholder,body textarea::placeholder{color:#737f90;opacity:1}
body input:disabled,body select:disabled,body textarea:disabled,body input[readonly],body textarea[readonly]{background:#e5e7eb;color:#697586}
.gb-item-editor{background:#fff}.gb-item-editor h4{margin:0 0 18px}.gb-item-actions button{min-height:40px}.gb-item-editor .grade-form > div{display:flex;gap:10px;flex-wrap:wrap}.gb-item-editor textarea{min-height:90px}

.gb-card > .gb-toolbar .gb-edit-contract-button{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:11px 18px;border-radius:8px;border:1px solid #b91c1c;background:#dc2626;color:#fff;font-weight:700;cursor:pointer;flex-shrink:0}.gb-card > .gb-toolbar .gb-edit-contract-button:hover,.gb-card > .gb-toolbar .gb-edit-contract-button.selected{background:#b91c1c;color:#fff}.gb-card > .gb-toolbar .gb-edit-contract-button:focus-visible{outline:3px solid #f87171;outline-offset:3px}@media(max-width:650px){.gb-card > .gb-toolbar .gb-edit-contract-button{width:100%}}

/* Ações do contrato separadas da navegação entre módulos. */
.gb-card > .gb-toolbar{align-items:flex-start}.gb-contract-tools{display:flex;flex-direction:column;align-items:flex-end;gap:12px;flex-shrink:0}.gb-contract-tools-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.gb-card > .gb-toolbar .gb-edit-contract-button{background:#fff;color:#254d3c;border:1px solid #b98b9f;min-height:36px;padding:8px 13px;font-size:12px;font-weight:600}
.gb-card > .gb-toolbar .gb-edit-contract-button:hover,.gb-card > .gb-toolbar .gb-edit-contract-button.selected{background:#f7eff3;color:#254d3c;border-color:#254d3c}
.gb-card > .gb-toolbar .gb-edit-contract-button:focus-visible{outline:2px solid #254d3c;outline-offset:3px}
.gb-contract-tools-actions .gb-archive-top .gb-archive-button{min-height:36px;padding:8px 13px;font-size:12px}
.gb-list > .gb-card > .gb-actions{background:#eef0f3;border:1px solid #e0e4ea;border-radius:10px;padding:14px;margin-top:20px;gap:10px}
.gb-list > .gb-card > .gb-actions button{background:#fff;border:1px solid #d5dae3;color:#344054;font-weight:600;min-height:40px;padding:10px 16px}
.gb-list > .gb-card > .gb-actions button:hover{background:#e5e9ef;border-color:#aab4c3}
.gb-list > .gb-card > .gb-actions button.selected{background:#254d3c;border-color:#254d3c;color:#fff}
@media(max-width:650px){.gb-contract-tools{align-items:flex-start;flex-shrink:1;width:100%}.gb-contract-tools-actions{justify-content:flex-start;width:100%}.gb-card > .gb-toolbar .gb-edit-contract-button{width:auto}.gb-contract-tools-actions .gb-archive-top{width:auto}.gb-list > .gb-card > .gb-actions{padding:12px;gap:8px}.gb-list > .gb-card > .gb-actions button{flex:1 1 130px}}

.gb-button-icon{display:inline-block;width:17px;height:17px;min-width:17px;vertical-align:middle;margin-right:7px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
body main button:not(:disabled):hover,body main a.botao:hover,body .gb-modal button:not(:disabled):hover{background:#254d3c!important;border-color:#254d3c!important;color:#fff!important}
body main button,body main a.botao,body .gb-modal button{transition:background-color .15s,color .15s,border-color .15s}

.gb-activity{background:#edf5f2;border:1px solid #bad7ca;border-left:4px solid #39745a;border-radius:10px;padding:16px;margin-top:18px}.gb-activity>strong{color:#27583f;font-size:14px}.gb-activity-values{display:flex;flex-wrap:wrap;gap:24px;margin:14px 0}.gb-activity-values small,.gb-activity-values b{display:block}.gb-activity-values small{font-size:12px;color:#53675e;margin-bottom:5px}.gb-activity-values b{font-size:18px;color:#243f32}.gb-activity p{font-size:12px;margin:7px 0}.gb-audit-data{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;background:#eef0f3;padding:12px}
