/* Regularizações: bloco do contrato */
.registry-block p,.registry-management p{white-space:pre-wrap;overflow-wrap:anywhere}
.registry-pending-summary{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:10px 0;color:var(--text-muted,#64748b)}
.registry-block-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}
.registry-block-footer>div{display:grid;gap:4px}
.registry-block-footer small{display:block;margin-top:4px;color:var(--text-muted,#64748b)}
.registry-block button{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.registry-status--overdue{background:#fde8e8;color:#9b1c1c}
.registry-status--completed{background:#e3f4e8;color:#13652e}
.registry-status--cancelled,.registry-status--awaiting_start{background:#eef2f7;color:#475569}
.registry-status--in_progress{background:#e8f0fb;color:#0a3f7d}

/* Janela de gestão */
.contract-secondary-dialog[data-secondary-id="registry-management"]{width:min(94vw,1120px)}
.contract-secondary-dialog[data-secondary-id="registry-management"] .contract-secondary-content{padding:0}
.registry-management{display:flex;flex-direction:column;min-width:0;color:#0b2341}
.registry-management [hidden]{display:none!important}
.registry-management button svg{width:18px;height:18px;flex-shrink:0}
.registry-label{display:block;font-size:var(--text-2xs);font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:#5b6b80}
.registry-sr-only{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.registry-contract-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 22px;border-bottom:1px solid #e2e8f0}
.registry-contract-heading strong{font-size:var(--text-md)}
.registry-contract-heading small{display:block;margin-top:2px;color:#5b6b80;font-size:var(--text-sm)}
.registry-new-button,.registry-actions .registry-primary,.registry-operation [type=submit]{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 16px;border-radius:8px;border:1px solid var(--brand-blue,#075db8);background:var(--brand-blue,#075db8);color:#fff;font-weight:600;cursor:pointer}
.registry-new-button:hover,.registry-actions .registry-primary:hover,.registry-operation [type=submit]:hover:not(:disabled){background:#064a92;border-color:#064a92}
.registry-operation button:disabled{opacity:.55;cursor:not-allowed}
.registry-empty{margin:0;padding:32px 22px;color:#5b6b80}
.registry-chip{display:inline-flex;align-items:center;min-height:24px;padding:2px 10px;border-radius:999px;font-size:var(--text-xs);font-weight:600;white-space:nowrap}
.registry-chip--effect{background:#e8f0fb;color:#0a3f7d}
.registry-chip--neutral{background:#eef2f7;color:#475569}

/* Lista lateral + detalhe */
.registry-shell{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:0}
.registry-list{display:flex;flex-direction:column;gap:18px;padding:18px 14px;background:#f5f7fa;border-right:1px solid #e2e8f0}
.registry-list-group{display:flex;flex-direction:column;gap:10px}
.registry-list-title{font-size:var(--text-xs);font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5b6b80;padding:0 4px}
.registry-card{display:flex;flex-direction:column;gap:6px;width:100%;min-height:44px;padding:12px 14px;text-align:left;background:#fff;border:1px solid #e2e8f0;border-radius:12px;color:#0b2341;font:inherit;cursor:pointer}
.registry-card:hover{border-color:#9db9d9}
.registry-card[aria-current=true]{border-color:var(--brand-blue,#075db8);box-shadow:0 0 0 1px var(--brand-blue,#075db8)}
.registry-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.registry-card-top strong{font-size:var(--text-base)}
.registry-card-party{font-size:var(--text-sm);color:#5b6b80}
.registry-card small{font-size:var(--text-xs);color:#5b6b80}
.registry-detail{display:flex;flex-direction:column;gap:18px;min-width:0;padding:22px 24px}
.registry-detail-head h3{margin:0;font-size:var(--text-xl)}
.registry-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.registry-original p{margin:0;font-size:var(--text-base);line-height:1.55;color:#33465e}
.registry-summary{padding:18px;border:1px solid #e2e8f0;border-radius:12px}
.registry-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.registry-summary-grid span{display:block;margin-bottom:6px;font-size:var(--text-2xs);font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:#5b6b80}
.registry-summary-grid strong{font-size:var(--text-base);overflow-wrap:anywhere}
.registry-tone--overdue strong{color:#9b1c1c}
.registry-tone--completed strong{color:#13652e}
.registry-bar{margin-top:18px}
.registry-bar-track{display:flex;height:10px;border-radius:999px;overflow:hidden;background:#eef2f7}
.registry-bar-fill{background:var(--brand-blue,#075db8)}
.registry-bar-late{background:repeating-linear-gradient(135deg,#d63b3b 0 6px,#e66a6a 6px 12px)}
.registry-bar-labels{display:flex;justify-content:space-between;gap:8px;margin-top:8px;font-size:var(--text-xs);color:#5b6b80}
.registry-bar-labels strong{color:#0b2341}
.registry-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.registry-actions button{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.registry-actions .registry-cancel{margin-left:auto}
.registry-history{border-top:1px solid #e2e8f0;padding-top:16px}
.registry-history h4{margin:0 0 14px;font-size:var(--text-md)}
.registry-history h4 span{font-weight:500;color:#5b6b80}
.registry-timeline{list-style:none;padding:0;margin:0;display:grid;gap:0}
.registry-timeline li{position:relative;padding:0 0 16px 24px}
.registry-timeline li::before{content:"";position:absolute;left:0;top:5px;width:12px;height:12px;border-radius:999px;background:#94a3b8}
.registry-timeline li:first-child::before{background:var(--brand-blue,#075db8)}
.registry-timeline li::after{content:"";position:absolute;left:5px;top:20px;bottom:0;width:2px;background:#e2e8f0}
.registry-timeline li:last-child{padding-bottom:0}
.registry-timeline li:last-child::after{display:none}
.registry-timeline article>div{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px}
.registry-timeline small{display:block;margin-top:2px}
.registry-timeline small,.registry-timeline time{font-size:var(--text-xs);color:#5b6b80}
.registry-timeline p{margin:6px 0;font-size:var(--text-base);line-height:1.5;color:#33465e}

/* Formulários de operação */
.registry-management--operation .registry-operation{padding:22px 24px}
.registry-operation h3{font-size:var(--text-md);margin:0 0 14px}
.registry-operation label{min-width:0}
.registry-operation input,.registry-operation select,.registry-operation textarea{width:100%;box-sizing:border-box}
.registry-operation [role=alert]{color:#b42318;margin:0}
.registry-operation .workflow-form{gap:12px}
.registry-operation .workflow-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.registry-operation .workflow-choice{display:flex;flex-wrap:wrap;gap:6px}
.registry-operation .workflow-choice-button{flex:1;min-height:44px}
.registry-operation .workflow-actions button{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.registry-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.registry-form-grid label{margin:0}
.registry-management .workflow-callout{margin:0;overflow-wrap:anywhere}
.registry-context{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:20px;align-items:center;padding:14px 22px;background:#f5f7fa;border-bottom:1px solid #e2e8f0}
.registry-context>div+div{border-left:1px solid #dbe2ea;padding-left:20px}
.registry-context strong{display:block;margin-top:4px;font-size:var(--text-base)}
.registry-context p{margin:4px 0 0;font-size:var(--text-base);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.registry-context-deadline{display:flex;align-items:center;gap:12px}
.registry-context-deadline span:not(.registry-label):not(.registry-chip){display:block;margin-top:4px;font-size:var(--text-base)}

/* Conclusão: passos + revisão */
.registry-management--operation .registry-operation--complete{padding:0}
.registry-complete{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:0}
.registry-complete-fields{display:flex;flex-direction:column;gap:26px;padding:24px 28px}
.registry-step{display:flex;gap:14px}
.registry-step--grow{flex-grow:1}
.registry-step>label{flex-grow:1;display:flex;flex-direction:column;gap:10px;font-size:var(--text-base);font-weight:700;line-height:28px}
.registry-step input{max-width:220px;min-height:44px}
.registry-step textarea{min-height:180px;resize:vertical;font-weight:400;line-height:1.5}
.registry-step small,.registry-review-note{font-size:var(--text-xs);font-weight:400;line-height:1.4;color:#5b6b80}
.registry-step-number{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:999px;background:#071b33;color:#fff;font-size:var(--text-sm);font-weight:700}
.registry-review{display:flex;flex-direction:column;gap:14px;padding:24px 22px;background:#f5f7fa;border-left:1px solid #e2e8f0}
.registry-review h4{display:flex;align-items:center;gap:14px;margin:0;font-size:var(--text-md)}
.registry-effect{list-style:none;margin:0;padding:16px;background:#fff;border:1px solid #e2e8f0;border-radius:12px}
.registry-effect-step{position:relative;padding:0 0 14px 24px}
.registry-effect-step:last-child{padding-bottom:0}
.registry-effect-step::before{content:"";position:absolute;left:0;top:4px;width:12px;height:12px;border-radius:999px;background:var(--brand-blue,#075db8);box-sizing:border-box}
.registry-effect-step::after{content:"";position:absolute;left:5px;top:20px;bottom:0;width:2px;background:#e2e8f0}
.registry-effect-step:last-child::after{display:none}
.registry-effect-step--now::before{background:#fff;border:2px solid #d97706}
.registry-effect-step--due::before{background:#c81e1e}
.registry-effect-step>div{display:flex;justify-content:space-between;gap:8px;font-size:var(--text-base)}
.registry-effect-step>div strong{font-weight:600}
.registry-effect-step>div span{font-weight:700}
.registry-effect-step--now>div{flex-direction:column;gap:2px}
.registry-effect-step small{display:block;font-size:var(--text-xs);color:#5b6b80}
.registry-effect-alert{margin:8px 0 0;padding:10px 12px;border-radius:8px;background:#fdecec;color:#7f1d1d;font-size:var(--text-sm);line-height:1.45}
.registry-effect-note{margin:0;padding:14px 16px;border-radius:12px;background:#fff;border:1px solid #e2e8f0;font-size:var(--text-base);line-height:1.5}
.registry-effect-note--warning{background:#fff4e0;border-color:#f3d19c;color:#5c3300}
.registry-effect-note--error{background:#fdecec;border-color:#f4c1c1;color:#7f1d1d}
.registry-operation .registry-confirmation{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;font-size:var(--text-base);line-height:1.45;cursor:pointer}
.registry-operation .registry-confirmation input{width:20px;min-width:20px;height:20px;margin:0;accent-color:var(--brand-blue,#075db8)}
.registry-review-actions{display:flex;flex-direction:column;gap:8px;margin-top:auto}
.registry-review-actions button{width:100%}
.registry-review-note{text-align:center;margin:0}

.registry-management button:focus-visible,.registry-management input:focus-visible,.registry-management select:focus-visible,.registry-management textarea:focus-visible{outline:3px solid var(--brand-blue,#075db8);outline-offset:2px}

@media(max-width:900px){
 .registry-shell{grid-template-columns:1fr}
 .registry-list{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid #e2e8f0;padding:12px 16px}
 .registry-list-group{flex-direction:row;align-items:stretch}
 .registry-list-title{display:none}
 .registry-card{min-width:210px}
 .registry-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .registry-complete{grid-template-columns:1fr}
 .registry-review{border-left:0;border-top:1px solid #e2e8f0}
 .registry-context{grid-template-columns:1fr;gap:10px}
 .registry-context>div+div{border-left:0;padding-left:0}
 .registry-block-footer{flex-wrap:wrap}
}
@media(max-width:560px){
 .registry-contract-heading,.registry-detail,.registry-management--operation .registry-operation,.registry-complete-fields,.registry-review{padding-left:16px;padding-right:16px}
 .registry-contract-heading{align-items:flex-start;flex-wrap:wrap}
 .registry-new-button{width:100%}
 .registry-form-grid,.registry-operation .workflow-form-grid{grid-template-columns:1fr}
 .registry-summary{padding:14px}
 .registry-actions button{width:100%}
 .registry-actions .registry-cancel{margin-left:0}
 .registry-step input{max-width:none}
 .registry-step{gap:10px}
 .registry-operation .workflow-actions{display:flex;flex-wrap:wrap;gap:8px}
 .registry-operation .workflow-actions button{flex:1 1 120px}
 .registry-operation .workflow-choice{flex-direction:column}
 .registry-block .section-title{flex-wrap:wrap}
 .registry-block-footer{align-items:stretch;flex-direction:column}
 .registry-block-footer button{width:100%}
}
@media(prefers-reduced-motion:reduce){.registry-card{transition:none}}
.registry-actions .registry-cancel{color:#b42318;border-color:transparent;background:transparent}
.registry-actions .registry-cancel:hover{background:#fdecec}
.registry-management--operation .workflow-actions{display:flex;align-items:center;gap:8px}
.registry-management--operation .registry-review-actions{flex-direction:column;align-items:stretch}
@media(max-width:560px){.registry-management--operation .registry-operation--complete{padding:0}}

/* Cadastro compacto: escopo restrito à nova regularização. */
.contract-secondary-backdrop:has(.registry-create){padding:22px}
.contract-secondary-dialog[data-secondary-id="registry-management"]:has(.registry-create){font-family:var(--font-sans);width:min(960px,100%);height:auto;max-height:calc(100dvh - 44px);border:0;border-radius:16px;box-shadow:0 22px 70px rgba(8,25,49,.25)}
.contract-secondary-dialog:has(.registry-create)>header{padding:19px 26px 17px;min-height:0;gap:12px;align-items:flex-start;border-color:#dae3ec;background:#fff}
.contract-secondary-dialog:has(.registry-create) .contract-secondary-content{display:flex;overflow:hidden;padding:0}
.contract-secondary-dialog:has(.registry-create) .registry-management{flex:1;min-height:0}
.registry-create-heading{display:flex;align-items:center;gap:14px;min-width:0;color:#112d50}
.registry-create-heading>div{min-width:0}
.registry-create-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:41px;height:41px;border:1px solid #d4e8fb;border-radius:11px;background:#edf5ff;color:#075baa}
.registry-create-icon svg{width:23px;height:23px}
.registry-create-eyebrow{display:block;font-size:var(--text-2xs);line-height:1.15;letter-spacing:1.1px;color:#647991;font-weight:700;text-transform:uppercase;margin-bottom:4px}
.contract-secondary-dialog .registry-create-heading h2{margin:0 0 6px;font-size:var(--text-xl);line-height:1.18;letter-spacing:-.45px;font-weight:700;color:#112d50}
.registry-create-property{display:flex;flex-wrap:wrap;gap:4px 8px;font-size:var(--text-xs);line-height:normal;color:#64748b;overflow-wrap:anywhere}
.registry-create-property strong{font-weight:700;color:#39526f}
.registry-create-property>span::before{content:"•";margin-right:8px;color:#9eacbc}
.contract-secondary-dialog:has(.registry-create) .secondary-close{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:34px;height:34px;min-height:34px;padding:0;border:1px solid #dfe7f0;border-radius:50%;background:#fff;color:#415875}
.contract-secondary-dialog:has(.registry-create) .secondary-close svg{width:18px;height:18px}
.contract-secondary-dialog:has(.registry-create) .secondary-close:hover{background:#f3f7fc}
.registry-management--operation .registry-create{display:flex;flex-direction:column;min-height:0;padding:0}
.registry-create .workflow-form{display:flex;flex-direction:column;gap:0;min-height:0;margin:0}
.registry-create-body{overflow:auto;overscroll-behavior:contain;min-height:0;padding:19px 26px 17px;scroll-padding:16px}
.registry-create-body>section+section{margin-top:19px}
.registry-create h3.registry-create-section{display:flex;align-items:center;gap:9px;margin:0 0 11px;font-size:var(--text-xs);font-weight:700;line-height:normal;color:#264467;letter-spacing:.1px}
.registry-create-section::after{content:"";height:1px;background:#e6ebf2;flex:1}
.registry-create .registry-form-grid{gap:13px}
.registry-create .registry-create-deadline{grid-template-columns:120px 166px minmax(190px,1fr) 175px}
.registry-create .registry-create-record{grid-template-columns:215px minmax(0,1fr);align-items:end;gap:14px}
.registry-create .workflow-form label{display:flex;flex-direction:column;gap:6px;margin:0;font-size:var(--text-xs);font-weight:700;line-height:1.2;color:#27405f}
.registry-create :is(input,select,textarea){min-width:0;max-width:100%;width:100%;height:38px;min-height:38px;margin:0;padding:0 11px;border:1px solid #d5dfeb;border-radius:8px;background:#fff;box-shadow:none;font:inherit;font-size:var(--text-xs);font-weight:600;color:#152e51;line-height:1.4}
.registry-create select{padding-right:27px}
.registry-create textarea{height:58px;min-height:54px;padding:9px 11px;resize:vertical;font-weight:400}
.registry-create :is(input,textarea)::placeholder{color:#8b9cb1;font-weight:400;opacity:1}
.registry-create :is(input,select,textarea):focus{border-color:#3786d9;box-shadow:0 0 0 3px #2381de22}
.registry-create-notice{display:flex;align-items:center;gap:7px;margin:12px 0 15px;padding:9px 11px;border:1px solid #dbeaf8;border-radius:8px;background:#f0f6fd;color:#255784;font-size:var(--text-xs);line-height:1.35}
.registry-create-notice svg{width:15px;height:15px;flex-shrink:0}
.registry-create-audit{display:flex;align-items:center;gap:9px;min-height:38px;padding:9px 11px;border:1px solid #e5edf4;border-radius:8px;background:#f8fafc;color:#657990;font-size:var(--text-2xs);line-height:1.4}
.registry-create-audit svg{width:16px;height:16px;flex-shrink:0;color:#7891a9}
.registry-create-retro{margin-top:14px;padding:11px;border:1px solid #f2dcad;border-radius:9px;background:#fffbf1}
.registry-create-retro p{margin:0 0 8px;font-size:var(--text-2xs);line-height:1.4;color:#886a3c}
.registry-create .registry-create-retro label{display:block;color:#7c5118}
.registry-create-retro textarea{display:block;margin-top:7px;border-color:#e7cc97}
.registry-create-required{font-size:var(--text-2xs);font-weight:600}
.registry-create [data-registry-error]:not([hidden]){margin-top:12px;font-size:var(--text-xs)}
.registry-create-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;padding:13px 26px;border-top:1px solid #dde6ef;background:#fff}
.registry-create-trace{display:flex;align-items:center;gap:7px;color:#75879a;font-size:var(--text-2xs)}
.registry-create-trace svg{width:15px;height:15px;flex-shrink:0}
.registry-create .workflow-actions{display:flex;align-items:center;gap:9px;margin:0;padding:0;border:0}
.registry-create .workflow-actions button{height:37px;min-height:37px;width:auto;margin:0;padding:0 17px;border-radius:8px;font-size:var(--text-xs);font-weight:700;white-space:nowrap}
.registry-create .workflow-actions .secondary-button{border:1px solid #d5e0ed;background:#fff;color:#365373}
.registry-create .workflow-actions .secondary-button:hover{background:#f5f8fc}
.registry-create .workflow-actions [type=submit]{border-color:#0759aa;background:#075eb8;box-shadow:0 2px 5px #075eb820}
.registry-create .workflow-actions [type=submit]:hover{background:#034d98}
.registry-create .workflow-actions [type=submit]:disabled{opacity:.6;cursor:wait}
.registry-create .workflow-actions svg{width:14px;height:14px}
.contract-secondary-dialog:has(.registry-create) :is(button,input,select,textarea):focus-visible{outline:3px solid #83bdff;outline-offset:2px}
@media(max-width:850px){
 .registry-create .registry-create-deadline,.registry-create .registry-create-record{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
 .contract-secondary-backdrop:has(.registry-create){padding:0;align-items:stretch}
 .contract-secondary-dialog[data-secondary-id="registry-management"]:has(.registry-create){width:100%;height:100dvh;max-height:100dvh;border-radius:0}
 .contract-secondary-dialog:has(.registry-create)>header{padding:16px 17px}
 .registry-create-heading{gap:14px}
 .registry-create-icon{width:36px;height:36px}
 .contract-secondary-dialog .registry-create-heading h2{font-size:var(--text-lg)}
 .registry-create-property{font-size:var(--text-2xs)}
 .registry-management--operation .registry-create{padding:0;flex:1}
 .registry-create .workflow-form{flex:1}
 .registry-create-body{flex:1;padding:17px}
 .registry-create .registry-form-grid,.registry-create .registry-create-record{grid-template-columns:1fr;gap:12px}
 .registry-create .registry-create-deadline{grid-template-columns:repeat(2,minmax(0,1fr))}
 .registry-create-deadline>label:nth-child(n+3){grid-column:1 / -1}
 .registry-create-footer{padding:12px 17px max(12px,env(safe-area-inset-bottom))}
 .registry-create-trace{display:none}
 .registry-create .workflow-actions{width:100%;flex-wrap:nowrap}
 .registry-create .workflow-actions button{flex:1;min-width:0;padding:0 10px}
 .registry-create-audit{min-height:42px}
}
@media(pointer:coarse){
 .registry-create :is(input,select),.registry-create .workflow-actions button{min-height:44px}
 .registry-create :is(input,select,textarea){font-size:var(--text-md)}
 .contract-secondary-dialog:has(.registry-create) .secondary-close{min-height:44px;width:44px}
}
