/* HAVAL LAWYER — CLIENT PORTAL 2.0
   Restrained design tokens built around the existing green/gold legal identity. */
#portalView{
 --hv2-forest:#124735;--hv2-ink:#20352c;--hv2-muted:#697a70;
 --hv2-line:#e1e9e3;--hv2-surface:#fff;--hv2-subtle:#f7faf7;
 --hv2-success:#176e4a;--hv2-warning:#95630d;--hv2-danger:#b43a3c;
 --hv2-radius:12px;--hv2-spacing:12px;
 color:var(--hv2-ink);
}
#portalView .main{min-width:0}
#portalView .content{max-width:1600px;margin-inline:auto;width:100%;min-width:0}
#portalView .nav{gap:3px}
#portalView .sidebar .nav button{min-height:40px}
#portalView .pagehead{align-items:center;margin-bottom:14px}
#portalView .pagehead h1{font-size:clamp(19px,2vw,23px);line-height:1.4}
#portalView .pagehead p{font-size:12px;line-height:1.7}
#portalView .dash-command{box-shadow:none}
#portalView .dash-command .dash-command-grid{gap:12px}
#portalView .dash-stat{box-shadow:none;min-height:0}
#portalView .dash-quick{border-radius:10px}
#portalView :is(.dash-panel,.company-info-section){box-shadow:none}
#portalView .hv-client-legal-head{display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px}
#portalView .hv-client-compliance-root{display:flex;flex-direction:column;gap:13px;min-width:0}
#portalView .hv-client-compliance-feedback{font-size:12px;line-height:1.7;color:var(--hv2-muted)}
#portalView .hv-client-compliance-feedback:empty{display:none}
#portalView .hv-v2-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#portalView .hv-v2-summary>div{
 display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;
 padding:10px 14px;border:1px solid var(--hv2-line);border-radius:10px;background:var(--hv2-surface)
}
#portalView .hv-v2-summary>div strong{font-size:22px;font-weight:850;line-height:1;color:var(--hv2-forest)}
#portalView .hv-v2-summary>div span{font-size:11px;color:var(--hv2-muted);line-height:1.6;text-align:end}
#portalView .hv-v2-section{border:1px solid var(--hv2-line);background:var(--hv2-surface);border-radius:var(--hv2-radius);padding:12px;min-width:0}
#portalView .hv-v2-section h2{display:flex;align-items:center;gap:7px;margin:0 0 12px;color:var(--hv2-forest);font-size:14px;font-weight:800}
#portalView .hv-v2-section h2 svg{width:18px;height:18px}
#portalView .hv-v2-confirmations{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#portalView .hv-v2-cert{padding:12px;min-width:0;border:1px solid var(--hv2-line);border-radius:10px;background:var(--hv2-subtle);display:flex;flex-direction:column;gap:8px}
#portalView .hv-v2-cert header{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0}
#portalView .hv-v2-cert header>strong{font-size:12px;color:var(--hv2-forest);line-height:1.5;overflow-wrap:anywhere}
#portalView .hv-v2-cert-name{font-size:11px;color:var(--hv2-ink);font-weight:750;line-height:1.65;overflow-wrap:anywhere}
#portalView .hv-v2-cert-dates{display:grid;gap:5px}
#portalView .hv-v2-data-line{display:flex;justify-content:space-between;align-items:flex-start;gap:7px;min-width:0;font-size:10px;line-height:1.6}
#portalView .hv-v2-data-line>span{color:var(--hv2-muted)}
#portalView .hv-v2-data-line>b{color:var(--hv2-ink);font-weight:750;overflow-wrap:anywhere;text-align:end}
#portalView .hv-v2-state{display:inline-flex;align-items:center;gap:5px;width:max-content;max-width:100%;padding:3px 7px;border-radius:7px;font-size:10px;font-weight:850;line-height:1.4}
#portalView .hv-v2-state svg{width:13px;height:13px;flex:none}
#portalView .hv-v2-state.valid{color:var(--hv2-success);background:#e6f4ec}
#portalView .hv-v2-state.warning{color:var(--hv2-warning);background:#fff2d8}
#portalView .hv-v2-state.expired{color:var(--hv2-danger);background:#fce9e8}
#portalView .hv-v2-state.undated{color:#65766b;background:#ebefeb}
#portalView .hv-v2-cert header>small,
#portalView .hv-v2-permit-actions>small{font-size:10px;color:var(--hv2-muted);line-height:1.45}
#portalView .hv-v2-file{margin-top:auto;display:inline-flex;align-items:center;gap:6px;align-self:flex-start;background:transparent;border:0;padding:6px 0;color:var(--hv2-success);font-size:11px;font-weight:750;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
#portalView .hv-v2-file svg{width:14px;height:14px}
#portalView .hv-v2-approvals{display:grid;gap:0}
#portalView .hv-v2-permit{display:grid;grid-template-columns:minmax(130px,1.1fr) minmax(200px,1.8fr) minmax(120px,.85fr);gap:12px;padding:11px 4px;align-items:center;border-top:1px solid var(--hv2-line);min-width:0}
#portalView .hv-v2-permit:first-child{border-top:0}
#portalView .hv-v2-permit-title{display:grid;gap:3px;min-width:0}
#portalView .hv-v2-permit-title strong{font-size:11px;color:var(--hv2-forest);line-height:1.6;overflow-wrap:anywhere}
#portalView .hv-v2-permit-title span{font-size:10px;color:var(--hv2-muted);overflow-wrap:anywhere}
#portalView .hv-v2-permit-dates{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
#portalView .hv-v2-permit-dates>.hv-v2-data-line{display:flex;flex-direction:column;gap:2px}
#portalView .hv-v2-permit-actions{display:flex;align-items:flex-start;justify-content:center;gap:4px;flex-direction:column}
#portalView .hv-v2-empty{font-size:12px;color:var(--hv2-muted);margin:4px 0;padding:12px;text-align:center}
#portalView .hv-v2-policy{display:flex;gap:7px;align-items:center;font-size:11px;color:var(--hv2-muted);line-height:1.7;margin:0}
#portalView .hv-v2-policy svg{width:14px;height:14px;flex:none}
#portalView .hv-client-compliance-skeleton{
 min-height:180px;border-radius:12px;
 background:linear-gradient(100deg,#f0f4f1 25%,#e8efe9 40%,#f0f4f1 60%);
 background-size:200% 100%;animation:hv2-skeleton 1.7s ease-in-out infinite;
}
@keyframes hv2-skeleton{to{background-position-x:-200%}}
#portalView .hv-v2-error{display:grid;place-content:center;justify-items:center;gap:8px;text-align:center;min-height:130px;border:1px dashed var(--hv2-line);border-radius:10px}
#portalView .hv-v2-error p{font-size:12px;color:var(--hv2-danger)}
#portalView .hv-v2-error button{border:1px solid var(--hv2-line);border-radius:8px;padding:8px 12px;color:var(--hv2-forest);background:var(--hv2-surface);cursor:pointer}
#portalView :is(.hv-v2-file,.hv-v2-error button):focus-visible{outline:3px solid #dbaf53;outline-offset:3px}
.hv-v2-preview{position:fixed;inset:0;z-index:4500;background:#0b1c17bf;display:grid;place-items:center;padding:12px;direction:rtl}
.hv-v2-preview[hidden]{display:none!important}
.hv-v2-preview>section{display:flex;flex-direction:column;width:min(880px,100%);max-height:min(90dvh,900px);background:#fff;color:#223e30;border-radius:12px;overflow:hidden;box-shadow:0 22px 80px #0004}
.hv-v2-preview header,.hv-v2-preview footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 15px}
.hv-v2-preview header{border-bottom:1px solid #e3e9e4;font-size:13px}
.hv-v2-preview footer{border-top:1px solid #e3e9e4;justify-content:flex-end}
.hv-v2-preview header button{display:grid;place-items:center;border:1px solid #e0e8e2;border-radius:7px;background:#fff;width:35px;height:35px;cursor:pointer}
.hv-v2-preview header button svg{width:17px;height:17px}
.hv-v2-preview-content{min-height:125px;overflow:auto;display:flex;align-items:center;justify-content:center;flex:1;padding:12px;font-size:12px}
.hv-v2-preview-content iframe{width:100%;height:min(65dvh,670px);border:0}
.hv-v2-preview-content img{max-width:100%;max-height:65dvh;object-fit:contain}
.hv-v2-preview footer a{color:#fff;background:#15553d;border-radius:8px;padding:9px 13px;text-decoration:none;font-size:12px;font-weight:750}
@media(max-width:1140px){#portalView .hv-v2-confirmations{grid-template-columns:repeat(2,minmax(0,1fr))}#portalView .hv-v2-permit{grid-template-columns:1fr 1.7fr}}
@media(max-width:800px){
 #portalView .content{padding-inline:12px;padding-bottom:calc(90px + env(safe-area-inset-bottom))}
 #portalView .hv-v2-permit{grid-template-columns:minmax(0,1fr);gap:9px}
 #portalView .hv-v2-permit-actions{flex-direction:row;align-items:center;flex-wrap:wrap;justify-content:flex-start}
 #portalView .hv-client-legal-head .btn{min-height:36px}
 #portalView .hv-v2-summary>div{padding:9px 10px}
 #portalView .hv-v2-summary>div strong{font-size:18px}
 #portalView .hv-v2-section{padding:10px}
}
@media(max-width:440px){
 #portalView .hv-v2-confirmations{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 #portalView .hv-v2-cert{padding:9px;gap:6px}
 #portalView .hv-v2-cert-dates{gap:4px}
 #portalView .hv-v2-summary>div{flex-direction:column;align-items:flex-start;gap:3px}
 #portalView .hv-v2-permit-dates{grid-template-columns:repeat(2,minmax(0,1fr))}
 #portalView .hv-v2-file{min-height:32px}
 #portalView .dash-quick-actions{gap:6px}
 #portalView .dash-quick{min-height:48px}
}
@media(max-width:350px){#portalView .hv-v2-confirmations{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){#portalView .hv-client-compliance-skeleton{animation:none}}
