/* Isolated Portal dashboard and document-viewer styles. */
.agp-progress-root{padding:16px 20px;background:linear-gradient(135deg,#111c33,#151529);border:1px solid #334155;border-radius:18px;color:#e2e8f0;box-sizing:border-box}
.agp-progress-heading{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 15px;align-items:center;margin-bottom:13px}
.agp-progress-heading h2{font-size:17px;font-weight:800;margin:0;color:#f8fafc}.agp-progress-subtitle{font-size:12px;color:#94a3b8}
.agp-progress-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,275px),1fr));gap:12px}
.agp-progress-card{padding:15px 16px;background:#070e20;border:1px solid #24334d;border-radius:14px;min-width:0}
.agp-progress-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap}
.agp-progress-contract{font-size:13px;overflow-wrap:anywhere;color:#cbd5e1;font-weight:650}
.agp-progress-value{font-size:24px;font-variant-numeric:tabular-nums;color:#fbbf24;white-space:nowrap}
.agp-progress-description,.agp-progress-percent{font-size:12px;color:#94a3b8;margin:8px 0}
.agp-progress-track{height:9px;border-radius:99px;background:#293449;overflow:hidden}
.agp-progress-fill{height:100%;background:linear-gradient(90deg,#10b981,#f59e0b);transition:width .25s ease;border-radius:99px}
.agp-progress-error{color:#fda4af;font-size:13px;margin:0}.agp-progress-empty{color:#94a3b8;font-size:13px}
body.agp-viewer-active{overflow:hidden!important}
.agp-viewer-backdrop{position:fixed;inset:0;z-index:2147483645;background:rgba(2,6,23,.94);display:flex;align-items:center;justify-content:center;padding:clamp(4px,1.5vw,16px);box-sizing:border-box}
.agp-viewer-panel{display:flex;flex-direction:column;width:min(100%,1600px);height:calc(100dvh - 24px);max-height:100%;background:#0f172a;border:1px solid #475569;border-radius:14px;overflow:hidden;box-sizing:border-box;box-shadow:0 16px 90px #0008}
.agp-viewer-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 15px;background:#0b1224;border-bottom:1px solid #334155;flex-wrap:wrap}
.agp-viewer-title{font-size:14px;color:#f8fafc;overflow-wrap:anywhere;min-width:0;flex:1}
.agp-viewer-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.agp-viewer-btn{background:#1e293b;color:#f8fafc;border:1px solid #334155;border-radius:7px;padding:8px 12px;min-height:37px;font-size:12px;font-weight:700;cursor:pointer}
.agp-viewer-btn:hover,.agp-viewer-btn[aria-pressed=true]{border-color:#f59e0b;color:#fbbf24}
.agp-viewer-content{display:flex;flex:1;min-height:0;min-width:0;overflow:auto;justify-content:center;align-items:flex-start;background:#202b3d;color:#e2e8f0}
.agp-viewer-frame{width:100%;height:100%;border:0;background:white;display:block;flex:1;min-width:0;min-height:0}
.agp-viewer-image{max-width:100%;max-height:100%;object-fit:contain;display:block;margin:auto;flex-shrink:0}
.agp-viewer-image.agp-viewer-actual{max-width:none;max-height:none;object-fit:initial;margin:0 auto}
.agp-viewer-error{margin:25px auto;padding:18px;color:#fecaca;text-align:center}
@media(max-width:620px){.agp-viewer-panel{height:calc(100dvh - 8px)}.agp-viewer-bar{padding:8px}.agp-viewer-title{width:100%;flex-basis:100%}.agp-viewer-actions{width:100%;justify-content:space-between;gap:4px}.agp-viewer-btn{padding:8px 6px;font-size:11px}}

.agp-viewer-note{display:block;color:#94a3b8;font-size:11px;font-weight:400;margin-top:3px;white-space:normal;max-height:3.4em;overflow:auto}

/* Mensagem discreta após quitação integral confirmada em overview e financeiro */
.agp-contract-paid-congrats{margin-top:14px;padding:14px 16px;border:1px solid #2c9d80;border-radius:12px;background:#0d3c35;color:#e8fff3}
.agp-contract-paid-congrats strong{display:block;font-size:14px;line-height:1.45}
.agp-contract-paid-congrats p{font-size:12px;line-height:1.5;color:#c5ebdf;margin:6px 0 0}

/* Client-only contract details: keep navigation reachable while the contract dialog is visible.
   Do not modify administrator modals or global stacking contexts. */
@media (max-width:639px) {
  .agp-client-contract-overlay {
    top:0;right:0;left:0;bottom:calc(4rem + env(safe-area-inset-bottom, 0px));
    z-index:40;
  }
  .agp-client-contract-overlay > div { max-height:100%; min-height:0; }
}
