@import url('variables.css');

@page { size: letter; margin: 0.6in 0.7in 0.7in 0.7in; }
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, Helvetica, sans-serif; color: var(--ink); margin: 0; padding: 24px 34px; font-size: 13px; line-height: 1.5; background:#fff; }

.doc-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--dark); padding-bottom: 10px; margin-bottom: 20px; }
.doc-header img { height: 34px; width: auto; }
.back-link { font-size: 12px; color: #4a6fa5; text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

.campaign-band { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-radius: 6px; margin: 6px 0 20px 0; color: #fff; }
.campaign-band .brand-name { font-size: 19px; font-weight: 700; }
.campaign-band .brand-url { font-size: 12.5px; opacity: 0.9; margin-top: 3px; }
.campaign-band a { color: #fff; text-decoration: underline; }
.campaign-band.b-aca { background: linear-gradient(90deg, var(--aca-from), var(--aca-to)); }
.campaign-band.b-fe { background: linear-gradient(90deg, var(--fe-from), var(--fe-to)); }
.campaign-band.b-medicare { background: linear-gradient(90deg, var(--medicare-from), var(--medicare-to)); }
.campaign-band.b-hi { background: linear-gradient(90deg, var(--hi-from), var(--hi-to)); }
.campaign-band.b-home { background: linear-gradient(90deg, var(--home-from), var(--home-to)); }

.status-pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 10px; font-weight: 600; letter-spacing: 0.3px; background: rgba(255,255,255,0.25); color: #fff; }

h2.subhead { font-size: 14px; text-transform: uppercase; letter-spacing: 0.8px; color: #2b3340; margin: 26px 0 6px 0; border-left: 4px solid var(--brand); border-bottom: 1px solid #d8dbe0; padding-left: 10px; padding-bottom: 6px; }
.section-sub { color: var(--ink-muted); font-size: 12px; margin: 0 0 12px 0; }

.img-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.img-grid.creatives img { width: 31.8%; border: 1px solid #d8dbe0; border-radius: 4px; }
.img-grid.previews img { width: 100%; border: 1px solid #d8dbe0; border-radius: 4px; margin-bottom: 10px; }

.compliance-box { background: var(--brand-light); border: 1px solid var(--brand-border); border-left: 4px solid var(--brand); border-radius: 4px; padding: 12px 14px; font-size: 11.5px; color: #4a5261; margin-top: 14px; }
.compliance-box strong { color: var(--ink); }

table.lead-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
table.lead-table th { background: var(--dark-deep); color: var(--accent-light); text-align: left; padding: 9px 10px; font-size: 11px; letter-spacing: 0.3px; }
table.lead-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.lead-table tr:nth-child(even) td { background: var(--surface); }
table.lead-table td.mono { font-family: 'Consolas', monospace; font-size: 11px; color: #4a5261; }

.type-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; background: #e8ecf2; color: #3a4555; }

.action-cell { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.btn-view { background: var(--accent); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; letter-spacing: 0.3px; }
.btn-view:hover { background: var(--accent-hover); }
.btn-pdf { background: #fff; color: #a3261f; border: 1px solid #d9a19c; padding: 5px 10px; border-radius: 4px; font-size: 10.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0.2px; }
.btn-pdf:hover { background: #fdf1f0; }
.btn-pdf.disabled { color: #a7acb4; border-color: var(--border); cursor: not-allowed; background: var(--surface); }
.btn-pdf .dot { width: 6px; height: 6px; border-radius: 50%; background: #c0342b; display: inline-block; }
.btn-pdf.disabled .dot { background: #b7bcc4; }

/* Campaign-colored buttons per page */
body:has(.b-aca) .btn-view { background: var(--aca-to); }
body:has(.b-aca) .btn-view:hover { background: var(--aca-from); }
body:has(.b-fe) .btn-view { background: var(--fe-to); }
body:has(.b-fe) .btn-view:hover { background: var(--fe-from); }
body:has(.b-medicare) .btn-view { background: var(--medicare-to); }
body:has(.b-medicare) .btn-view:hover { background: var(--medicare-from); }
body:has(.b-hi) .btn-view { background: var(--hi-to); }
body:has(.b-hi) .btn-view:hover { background: var(--hi-from); }
body:has(.b-home) .btn-view { background: var(--home-to); }
body:has(.b-home) .btn-view:hover { background: var(--home-from); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(12,15,20,0.62); z-index: 999; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-card { background: #fff; width: 420px; max-width: 90%; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.modal-head { background: linear-gradient(90deg, var(--dark-deep), #262f3d); color: var(--accent-light); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.modal-head .title { font-size: 15px; font-weight: 700; color: #fff; }
.modal-head .close-x { cursor: pointer; font-size: 18px; color: #cfd6df; background: none; border: none; }
.modal-body { padding: 18px 20px; }
.modal-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #eef0f3; font-size: 12.5px; }
.modal-row:last-child { border-bottom: none; }
.modal-row .label { color: #6b7280; font-weight: 600; }
.modal-row .value { color: var(--ink); text-align: right; max-width: 60%; word-break: break-all; }
.modal-foot { padding: 12px 20px 18px 20px; display: flex; justify-content: space-between; align-items: center; }
.modal-foot button { background: var(--dark); color: #fff; border: none; padding: 8px 16px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.modal-foot .pdf-link { background: #a3261f; color: #fff; }
.modal-foot .pdf-link:hover { background: #85201a; }

.footer-note { margin-top: 26px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 10px; color: #8b93a0; text-align: center; }

@media (max-width: 640px) {
  .img-grid.creatives img { width: 100%; }
}

@media print { .back-link, .btn-view, .btn-pdf { display: none; } .modal-overlay { display: none !important; } }
