/* Client Portal page — standalone layout linked from client-portal.php after css/geral.css. */

html, body { overflow-x: hidden; overflow-y: auto; height: auto; }
body { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 100vh; background: #383431; color: #fff; font-family: system-ui, -apple-system, sans-serif; }
.portal-container { max-width: 960px; width: 100%; text-align: left; }
.portal-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.portal-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(37,99,235,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; tracking: 0.05em; }
.portal-title { font-size: 2rem; font-weight: 700; margin: 8px 0 4px; color: #fff; }
.portal-subtitle { color: #aaa; font-size: 0.95rem; margin: 0; }
.portal-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-action { background: rgba(37,99,235,0.2); border: 1px solid rgba(59,130,246,0.4); color: #93c5fd; padding: 6px 14px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-action:hover { background: #2563eb; color: #fff; }
.btn-action.btn-approve { background: #10b981; color: #fff; border-color: #059669; }
.btn-action.btn-approve:hover { background: #059669; }
.btn-action.btn-signed { background: rgba(16,185,129,0.1); color: #34d399; border-color: rgba(16,185,129,0.3); cursor: default; }
.btn-action.retainer { background: #2563eb; color: #fff; border-color: #1d4ed8; }
.btn-action.link { text-decoration: none; }

.project-summary-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 24px; margin-bottom: 28px; backdrop-filter: blur(8px); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 20px; }
.summary-item .label { font-size: 0.75rem; text-transform: uppercase; color: #888; letter-spacing: 0.05em; margin-bottom: 4px; }
.summary-item .val { font-size: 1.1rem; font-weight: 600; color: #fff; }

.overall-progress-wrapper { margin-top: 16px; }
.progress-label-bar { display: flex; justify-content: space-between; font-size: 0.85rem; color: #ccc; margin-bottom: 8px; font-weight: 500; }
.progress-track { height: 12px; background: rgba(255,255,255,0.1); border-radius: 6px; overflow: hidden; position: relative; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); border-radius: 6px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-fill.green { background: #10b981; }
.progress-fill.amber { background: #f59e0b; }
.progress-fill.w75 { width: 75%; }
.progress-fill.w100 { width: 100%; }
.progress-fill.w85 { width: 85%; }
.progress-fill.w0 { width: 0%; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: #aaa; padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; font-weight: 500; }
.filter-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.filter-btn.active { background: #2563eb; color: #fff; border-color: #3b82f6; }

.milestones-list { display: flex; flex-direction: column; gap: 20px; }
.milestone-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 24px; backdrop-filter: blur(8px); transition: border-color 0.2s; }
.milestone-card:hover { border-color: rgba(255,255,255,0.18); }
.milestone-card.approved { border-left: 4px solid #10b981; }
.milestone-card.pending { border-left: 4px solid #f59e0b; }
.milestone-card.in_progress { border-left: 4px solid #3b82f6; }

.milestone-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.milestone-title { font-size: 1.15rem; font-weight: 600; color: #fff; margin: 0 0 4px; }
.milestone-desc { font-size: 0.9rem; color: #aaa; margin: 0; line-height: 1.5; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-pill.approved { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.status-pill.pending { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.status-pill.in_progress { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }

.milestone-progress { margin: 16px 0; }
.deliverables-box { background: rgba(0,0,0,0.2); border-radius: 8px; padding: 14px 16px; margin-top: 16px; border: 1px solid rgba(255,255,255,0.05); }
.deliverables-title { font-size: 0.8rem; font-weight: 600; color: #ccc; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.deliverable-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.85rem; }
.deliverable-item:last-child { border-bottom: none; }
.deliverable-name { color: #ddd; display: flex; align-items: center; gap: 8px; }
.deliverable-actions { display: flex; }

/* Modal Deliverable Preview & Approval */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(6px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.25s ease; padding: 20px; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-card { background: #242220; border: 1px solid rgba(255,255,255,0.15); border-radius: 16px; width: 100%; max-width: 640px; padding: 28px; color: #fff; box-shadow: 0 20px 40px rgba(0,0,0,0.5); position: relative; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: #aaa; font-size: 1.5rem; cursor: pointer; min-width: 44px; min-height: 44px; }
.modal-close:hover { color: #fff; }
.modal-sub { font-size: 0.75rem; color: #93c5fd; text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; margin-bottom: 6px; }
.modal-title { font-size: 1.3rem; margin: 0 0 12px; color: #fff; }
.modal-desc { color: #ccc; font-size: 0.9rem; line-height: 1.6; margin-bottom: 16px; }
.modal-hash-box { background: rgba(0,0,0,0.3); padding: 12px; border-radius: 8px; font-family: monospace; font-size: 0.8rem; color: #93c5fd; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.08); }
.modal-hash-box strong { color: #aaa; }

.signature-box { background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.2); border-radius: 10px; padding: 16px; margin-top: 20px; }
.signature-box h4 { margin: 0 0 8px; font-size: 0.95rem; color: #fff; }
.signature-box p { font-size: 0.8rem; color: #aaa; margin-bottom: 12px; }
.signature-box label { font-size: 0.8rem; color: #ccc; }
.form-input { width: 100%; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 0.9rem; margin-top: 6px; margin-bottom: 12px; }
.form-input:focus { outline: none; border-color: #3b82f6; }
.btn-approve-full { width: 100%; margin-top: 8px; padding: 10px; }

.already-approved-msg { display: none; background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); border-radius: 8px; padding: 14px; text-align: center; color: #34d399; font-size: 0.9rem; font-weight: 600; margin-top: 16px; }

.back-nav { display: inline-flex; align-items: center; gap: 6px; color: #aaa; text-decoration: none; font-size: 0.9rem; margin-top: 28px; }
.back-nav:hover { color: #fff; }
