/* Company document views, scoped so existing application sections retain their layout. */
.cd-page{max-width:1120px;margin-inline:auto;color:var(--ink)}
.cd-page [hidden]{display:none!important}.cd-page button{font:inherit;cursor:pointer}
.cd-page h1,.cd-page h2,.cd-page p{margin:0}.cd-page h1{font-size:24px;line-height:1.55}.cd-page h2{font-size:17px;line-height:1.65;overflow-wrap:anywhere}
.cd-page-title,.cd-company-hero{background:#0f3251;color:#fffdf9;padding:24px;border-radius:20px;display:flex;align-items:center;gap:16px}
.cd-page-title{justify-content:space-between;gap:12px;margin-bottom:18px}.cd-page-title small{color:#d8c9ad;font-size:12px}.cd-refresh{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;min-height:42px}.cd-refresh svg{width:18px;height:18px}
.cd-page-title .cd-refresh{color:#f3eadb;border-color:#ffffff40;background:#ffffff0a}
.cd-search{position:relative;display:flex;align-items:center;gap:12px;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:0 15px;margin-block:16px;color:var(--muted)}
.cd-search>svg{width:22px;height:22px;flex-shrink:0}.cd-search input{min-width:0;width:100%;min-height:52px;margin:0!important;border:0!important;background:transparent!important;box-shadow:none!important;outline-offset:2px;color:var(--ink);font:inherit;font-size:14px;padding:12px 0!important}
.cd-search:focus-within{outline:2px solid #6a91ba;outline-offset:2px}
.cd-filters{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0 22px}.cd-filter{border:1px solid var(--line);border-radius:24px;min-height:42px;padding:9px 19px;background:var(--soft);color:var(--ink);font-size:13px!important}.cd-filter[aria-pressed=true]{background:#0f3251;color:#fff;border-color:#0f3251}
.cd-companies,.cd-documents{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.cd-company-card,.cd-document-card,.cd-document-detail,.cd-attachments{background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:0 3px 12px #0f325106;padding:20px;min-width:0}
.cd-company-top{display:flex;gap:14px;align-items:center}.cd-company-copy{flex:1;min-width:0}.cd-company-copy p{color:var(--muted);font-size:12px;margin-top:4px}.cd-emblem{display:inline-flex;position:relative;width:64px;height:64px;align-items:center;justify-content:center;flex-shrink:0;border-radius:14px;background:#eaf1f8;color:#123550;overflow:hidden;border:1px solid #dae5ef}.cd-emblem>svg{width:34px;height:34px}.cd-emblem>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:5px;background:#fff}
.cd-summary{display:flex;flex-wrap:wrap;gap:7px;margin-top:15px;min-height:30px;align-items:center}.cd-status{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 10px;border-radius:10px;font-size:12px;line-height:1.5;font-weight:700;white-space:normal}.cd-dot{width:7px;height:7px;border-radius:50%;background:currentColor;display:inline-block;flex-shrink:0}.cd-status.expired{color:#a92e2b;background:#ffeded}.cd-status.soon{color:#925600;background:#fff1d7}.cd-status.valid{color:#076445;background:#e4f6ec}.cd-status.undated{color:#506174;background:#edf1f5}.cd-empty-note{font-size:12px;color:var(--muted)}
.cd-company-open{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--soft);color:var(--ink);border:1px solid var(--line);border-radius:11px;min-height:44px;padding:9px 14px;margin-top:17px;font-size:14px!important;font-weight:700!important}.cd-company-open svg{width:18px;height:18px}[dir=ltr] .cd-company-open svg{transform:rotate(180deg)}.cd-company-open:hover{border-color:#7f9bb5;background:var(--panel)}
.cd-link-note{font-size:11px;color:var(--muted);margin-top:10px!important}.cd-detail-heading{display:flex;align-items:center;gap:12px;margin-bottom:18px}.cd-company-hero{flex:1;min-width:0}.cd-company-hero h1{font-size:23px;overflow-wrap:anywhere}.cd-company-hero p{color:#d8c9ad;font-size:12px;margin-top:2px}.cd-company-hero .cd-emblem{background:#fff;border-color:#fff}.cd-company-totals{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-block:12px}.cd-company-totals .cd-summary{margin:0}
.cd-document-top{display:flex;align-items:flex-start;gap:12px}.cd-document-copy{flex:1;min-width:0}.cd-document-copy small{display:block;color:var(--muted);font-size:12px;margin-top:7px}.cd-expiry{font-size:15px;margin-top:2px!important}.cd-file-icon{display:flex;align-items:center;justify-content:center;width:48px;height:56px;border-radius:12px;flex-shrink:0;background:var(--soft);color:var(--ink)}.cd-file-icon svg{width:28px;height:28px}.cd-file-icon.expired{background:#ffeded;color:#a92e2b}.cd-file-icon.soon{background:#fff1d7;color:#925600}.cd-file-icon.valid{background:#e4f6ec;color:#076445}.cd-document-open{width:100%;margin-top:18px;display:flex;gap:8px;justify-content:center;min-height:44px}.cd-document-open svg{width:18px;height:18px}.cd-document-top>.cd-status{font-size:11px;padding:5px 8px;max-width:110px;flex-shrink:0}
.cd-footnote{margin-top:22px!important;color:var(--muted);font-size:12px;line-height:1.9}.cd-empty{padding:24px 10px!important;color:var(--muted);grid-column:1/-1;text-align:center;line-height:1.8}.cd-detail-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.cd-fields{display:grid;grid-template-columns:minmax(100px,.4fr) minmax(0,1fr);gap:14px;margin:24px 0 0}.cd-fields dt{color:var(--muted);font-size:13px}.cd-fields dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap;font-size:14px}.cd-attachments{margin-top:16px}.cd-attachment{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--line);font-size:13px}.cd-attachment>span{display:flex;align-items:center;gap:8px;min-width:0;overflow-wrap:anywhere}.cd-attachment svg{width:20px;height:20px;flex-shrink:0}.cd-attachment bdi{overflow-wrap:anywhere}.cd-attachment .secondary{flex-shrink:0;min-height:42px;font-size:12px}.cd-attachments details{margin-top:16px}.cd-attachments summary{cursor:pointer;padding:10px 0;font-size:14px}
.cd-profile-company{display:flex;align-items:center;gap:14px;margin:18px 0;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--soft)}.cd-profile-company[hidden]{display:none}.cd-profile-company small,.cd-profile-company strong{display:block}.cd-profile-company small{font-size:12px;color:var(--muted);margin-bottom:5px}.cd-profile-company strong{font-size:16px;overflow-wrap:anywhere}.cd-profile-company .cd-emblem{width:58px;height:58px}
[data-theme=dark] .cd-filter[aria-pressed=true]{background:#e6d8bf;color:#0c2a43;border-color:#e6d8bf}[data-theme=dark] .cd-status.expired{color:#ffb5ad;background:#5b252c}[data-theme=dark] .cd-status.soon{color:#ffe0a0;background:#58401d}[data-theme=dark] .cd-status.valid{color:#9de5c0;background:#164937}[data-theme=dark] .cd-status.undated{color:#d0d9e3;background:#354657}
@media(max-width:850px){.cd-companies,.cd-documents{grid-template-columns:1fr}.cd-detail-heading{align-items:center}.cd-company-hero{padding:20px}}
@media(max-width:480px){.cd-page h1{font-size:20px}.cd-page-title{padding:20px 17px;gap:9px;align-items:flex-start}.cd-page-title .cd-refresh{font-size:11px;padding:8px;min-height:38px}.cd-company-card,.cd-document-card,.cd-document-detail,.cd-attachments{padding:17px}.cd-company-hero h1{font-size:19px}.cd-company-hero{padding:18px 15px;gap:11px}.cd-detail-heading{flex-wrap:wrap}.cd-detail-heading>.cd-refresh{margin-inline-start:auto}.cd-emblem{width:58px;height:58px}.cd-summary{gap:6px}.cd-status{font-size:11px;padding:6px 8px}.cd-filter{padding:8px 14px;font-size:12px!important}.cd-filters{gap:6px}.cd-document-top{gap:9px}.cd-file-icon{width:39px;height:48px}.cd-document-top>.cd-status{max-width:90px;font-size:10px;gap:4px}.cd-document-copy h2{font-size:15px}.cd-document-copy small{font-size:11px}.cd-expiry{font-size:14px}.cd-attachment{flex-wrap:wrap}.cd-attachment>span{width:100%}.cd-attachment .secondary{margin-inline-start:auto}.cd-fields{grid-template-columns:95px minmax(0,1fr);gap:13px}.cd-fields dd{font-size:13px}}
.cd-status.pending_renewal {
  color: #365574;
  background: #e7edf4;
}

[data-theme=dark] .cd-status.pending_renewal {
  color: #c9d9ec;
  background: #2f4762;
}

.cd-document-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.cd-document-top > .cd-document-statuses {
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  max-width: 110px;
}

.cd-detail-title { flex-wrap: wrap; }
.cd-detail-title h2 { flex: 1 1 180px; min-width: 0; }

@media (max-width: 480px) {
  .cd-document-top > .cd-document-statuses { max-width: 90px; }
  .cd-document-top .cd-status { font-size: 10px; gap: 4px; }
}
