/* Shared brand surfaces, loaded after the legacy portal layout. */
body.portal-body,
body.portal-body.admin-surface {
    --primary: #e30000;
    --primary-dark: #b90000;
    --secondary: #111325;
    --text: #404040;
    --muted: #606473;
    --border: #dfe1e6;
    --shadow: 0 4px 18px rgba(17,19,37,.05);
    color: var(--text);
    background: #f1f2f4;
    background-image: none;
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0;
    color-scheme: light;
}
body.portal-body .portal-shell { width: min(1280px, calc(100% - 48px)); padding-top: 0; }
body.portal-body .portal-header {
    min-height: 96px;
    margin-bottom: 32px;
    padding: 18px 0;
    border-bottom: 2px solid var(--primary);
}
body.portal-body .portal-brand img { width: 50px; height: 50px; border-radius: 8px; box-shadow: none; border: 0; }
body.portal-body .portal-brand strong { color: var(--secondary); font-size: 20px; }
body.portal-body .portal-brand span { color: var(--primary); }
body.portal-body :is(.portal-card h1, .portal-card h2, .portal-card h3, .policy-top h3, .tracking-item h3, .archive-document-copy h2) { color: var(--secondary); }
body.portal-body .portal-card h1 { font-size: 30px; }
body.portal-body .portal-card h2 { font-size: 23px; }
body.portal-body .portal-card h3 { font-size: 19px; }
body.portal-body .portal-card p { color: var(--muted); font-size: 15px; }
body.portal-body .portal-card { background: #fafafb; border-color: var(--border); border-radius: 8px; box-shadow: none; padding: 24px; }
body.portal-body .portal-shell main:not(.portal-grid) > .portal-card,
body.portal-body main.customer-dashboard {
    padding: 0 0 28px;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 28px;
}
body.portal-body :is(.portal-link, .portal-button, .admin-mini-button) {
    min-height: 44px;
    border-radius: 6px;
    background: #fafafb;
    border-color: #cbd0d8;
    color: var(--secondary);
    box-shadow: none;
    transition: background-color .18s, border-color .18s;
}
body.portal-body :is(.portal-link, .portal-button, .admin-mini-button):hover {
    transform: none;
    box-shadow: none;
    background: #e9ebef;
    border-color: #a1a8b5;
}
body.portal-body :is(.portal-button.primary, .portal-link.primary) { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }
body.portal-body :is(.portal-button.primary, .portal-link.primary):hover { background: var(--primary-dark); border-color: var(--primary-dark); }
body.portal-body .portal-link.document { background: var(--secondary); border-color: var(--secondary); color: #fff; }
body.portal-body .portal-link.document:hover { background: #282c43; }
body.portal-body .portal-link.receipt { background: #edf0f4; color: var(--secondary); border-color: #b8bec8; }
body.portal-body :is(.portal-link.document, .portal-link.receipt)::before {
    content: "";
    width: 20px;
    min-width: 20px;
    height: 20px;
    border-radius: 0;
    color: inherit;
    background: currentColor;
    mask: url('../images/carousel-document.svg') center / contain no-repeat;
}
body.portal-body .portal-link.receipt::before { mask-image: url('../images/carousel-receipt.svg'); }
body.portal-body .portal-link.pdf-request { background: #eef8f2; color: #176d40; border-color: #abcbb7; }
body.portal-body .portal-link.disabled { background: #e9ebef; color: #606473; opacity: .75; }
body.portal-body :is(.portal-form label, .admin-filter-form label, .archive-search label) { color: var(--secondary); font-size: 14px; }
body.portal-body :is(.portal-form input, .portal-form select, .portal-form textarea, .admin-filter-form input, .admin-filter-form select, .archive-search input) {
    color: var(--secondary);
    background: #fff;
    border: 1px solid #c6cbd4;
    border-radius: 6px;
    color-scheme: light;
    font-size: 16px;
    min-height: 46px;
}
body.portal-body input::placeholder,
body.portal-body textarea::placeholder { color: #757b87; }
body.portal-body :is(input, select, textarea):focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(227,0,0,.09); }
body.portal-body :is(.portal-link, .portal-button, .admin-mini-button, summary):focus-visible { outline-color: var(--primary); }
body.portal-body .portal-form input[type="file"]::file-selector-button { background: #edf0f4; color: var(--secondary); border-color: #b8bec8; }
body.portal-body :is(.auth-helper, .customer-mini-card, .policy-card, .admin-stat-card, .detail-info-card, .bulk-import-card, .tracking-item, .archive-document-card) {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafb;
    box-shadow: none;
}
body.portal-body :is(.policy-meta div, .tracking-meta div, .payment-plan-list div, .admin-filter-form, .tracking-result-bar, .archive-result, .tracking-followup, .archive-upload, .tracking-import-note, .payment-plan) {
    border-color: var(--border);
    border-radius: 6px;
    background: #eaedf1;
    box-shadow: none;
}
body.portal-body :is(.detail-info-card strong, .customer-mini-card strong, .tracking-meta dd, .tracking-contact span, .archive-result strong, .archive-empty strong, .tracking-empty strong, .bulk-import-card strong, .tracking-import-note strong, .policy-meta strong, .payment-plan-list strong, .payment-plan summary, .tracking-followup summary, .archive-upload summary) { color: var(--secondary); }
body.portal-body :is(.detail-info-card span, .customer-mini-card span, .policy-meta small, .policy-note, .form-hint, .admin-filter-result, .birthday-item span, .renewal-item span, .tracking-item-main > p, .tracking-meta dt, .tracking-contact small, .archive-document-copy small, .archive-result span, .archive-empty span, .tracking-empty span, .bulk-import-card p, .bulk-import-card small) { color: var(--muted); }
body.portal-body :is(.dashboard-stats div, .admin-stat-card) { border-radius: 8px; background: #fafafb; min-height: 94px; box-shadow: none; }
body.portal-body :is(.dashboard-stats div, .admin-stat-card)::after { display: none; }
body.portal-body :is(.admin-stat-card strong, .dashboard-stats strong) { color: var(--secondary); font-size: 30px; }
body.portal-body :is(.admin-stat-card span, .dashboard-stats small) { color: var(--muted); }
body.portal-body :is(.admin-stat-card.alert, .admin-stat-card.opportunity) { background: #fafafb; border-top: 3px solid var(--primary); }
body.portal-body :is(.portal-eyebrow, .dashboard-eyebrow) { background: none; padding: 0; border-radius: 0; min-height: 0; margin-bottom: 10px; color: var(--primary); }
body.portal-body :is(.birthday-reminder, .renewal-reminder, .renewal-summary, .renewal-callout) { background: #fafafb; border: 1px solid #d9bd83; border-radius: 8px; box-shadow: none; }
body.portal-body :is(.birthday-reminder-header strong, .renewal-reminder-header strong, .birthday-item strong, .renewal-item strong, .renewal-summary strong, .renewal-callout strong) { color: var(--secondary); }
body.portal-body :is(.birthday-reminder-header span, .birthday-reminder-header em, .renewal-reminder-header span, .renewal-reminder-header em) { color: var(--muted); }
body.portal-body :is(.birthday-item, .renewal-item) { border-color: var(--border); background: #f1f2f4; border-radius: 6px; }
body.portal-body :is(.policy-note, .tracking-note) { background: #edf0f4; border-color: var(--border); color: var(--text) !important; border-radius: 6px; }
body.portal-body .portal-notice { background: #fff3f3; color: #a80000; border-color: #e7b4b4; border-radius: 6px; }
body.portal-body .portal-notice.success { background: #eef8f2; color: #176d40; border-color: #b1cbbb; }
body.portal-body .admin-table th { background: #e7eaf0; color: var(--secondary); border-color: var(--border); }
body.portal-body :is(.admin-table td, .admin-table small) { color: var(--text); border-color: var(--border); }
body.portal-body .admin-table tbody tr:nth-child(even) { background: #eceff3; }
body.portal-body .admin-table tbody tr:hover { background: #e3e7ed; }
body.portal-body :is(.admin-filter-result, .tracking-result-bar, .archive-result) { background: #e7eaf0; }
body.portal-body :is(.admin-mini-button.preview, .admin-mini-button.document) { color: var(--secondary); background: #edf0f4; border-color: #b8bec8; }
body.portal-body :is(.admin-mini-button.renewal-whatsapp, .birthday-whatsapp, .renewal-whatsapp) { color: #176d40; background: #eef8f2; border-color: #abcbb7; }
body.portal-body .archive-total { background: var(--secondary); color: #fff; border-color: var(--secondary); }
body.portal-body .archive-tabs a { color: var(--secondary); background: #fafafb; border-color: var(--border); border-radius: 6px; }
body.portal-body .archive-tabs a strong { background: #e7eaf0; color: var(--text); }
body.portal-body :is(.archive-tabs a.active, .tracking-tabs a.active) { color: #fff; background: var(--secondary); border-color: var(--secondary); }
body.portal-body .archive-tabs a.active strong { background: #404456; color: #fff; }
body.portal-body .tracking-tabs { border-color: #cbd0d8; }
body.portal-body .tracking-tabs a { color: var(--text); border-radius: 6px 6px 0 0; }
body.portal-body .tracking-tabs a:hover { color: var(--secondary); background: #e7eaf0; }
body.portal-body :is(.tracking-side, .tracking-followup[open] summary, .archive-upload[open] summary, .archive-document-actions) { border-color: var(--border); }
body.portal-body .archive-document-icon { color: var(--primary); background: #f5e5e5; }
body.portal-body .archive-document-card.type-registration .archive-document-icon { color: var(--secondary); background: #e7eaf0; }
body.portal-body .archive-document-card.type-customer_card .archive-document-icon { color: #176d40; background: #e1ede5; }
body.portal-body.admin-surface .archive-document-actions .admin-mini-button.danger { color: #fff; background: #b90000; border-color: #b90000; }
body.portal-body :is(.archive-empty, .tracking-empty) { border-color: #b8bec8; }
body.portal-body .bulk-import-card code { color: var(--secondary); background: #e7eaf0; border-color: var(--border); }
body.portal-body .dashboard-hero h1 { font-size: 30px; }
body.portal-body .policy-card { padding: 22px; }
body.portal-body .policy-meta { gap: 10px; }
body.portal-body .policy-actions { gap: 10px; }

/* Authentication pages share the website's bright family photography. */
body.portal-body.portal-auth { background: #f9f9f9; }
body.portal-auth .portal-shell { max-width: 1180px; }
body.portal-auth .portal-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; padding-top: 12px; }
body.portal-auth .auth-promo { padding: 18px 0 0; border: 0; background: none; box-shadow: none; overflow: hidden; }
body.portal-auth .auth-promo h1 { font-size: 34px; max-width: 480px; }
body.portal-auth .auth-promo p { max-width: 470px; margin: 14px 0 20px; }
body.portal-auth .auth-family-image { display: block; width: 100%; height: 330px; object-fit: cover; object-position: right center; border-radius: 0; }
body.portal-auth .portal-grid > .portal-card:not(.auth-promo) { padding: 30px; background: #fff; box-shadow: var(--shadow); }
body.portal-auth .auth-helper { padding: 18px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; }
body.portal-auth .auth-helper p { font-size: 13px; }
body.portal-auth .password-reset-link { color: var(--primary); background: none; }
body.portal-auth .portal-hero-list { display: none; }
@media (max-width: 900px) {
    body.portal-body .portal-header { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
    body.portal-body .portal-actions { justify-content: flex-start; }
    body.portal-auth .portal-grid { gap: 24px; }
    body.portal-auth .auth-promo h1 { font-size: 28px; }
    body.portal-auth .auth-family-image { height: 275px; }
}
@media (max-width: 640px) {
    body.portal-body .portal-shell { width: calc(100% - 28px); padding-bottom: 28px; }
    body.portal-body .portal-header { min-height: 78px; padding: 14px 0; margin-bottom: 22px; gap: 12px; }
    body.portal-body .portal-brand { gap: 10px; }
    body.portal-body .portal-brand img { width: 42px; height: 42px; }
    body.portal-body .portal-brand strong { font-size: 16px; }
    body.portal-body .portal-brand span { font-size: 11px; }
    body.portal-body :is(.portal-card h1, .dashboard-hero h1) { font-size: 25px; }
    body.portal-body .portal-card h2 { font-size: 21px; }
    body.portal-body .portal-link { font-size: 12px; padding: 10px 12px; }
    body.portal-body .portal-actions { width: 100%; gap: 8px; }
    body.portal-body .portal-card { padding: 18px; }
    body.portal-body .customer-dashboard { padding: 0; }
    body.portal-body .policy-card { padding: 18px; }
    body.portal-body .dashboard-stats { gap: 8px; }
    body.portal-body .dashboard-stats div { min-height: 92px; padding: 12px; }
    body.portal-body .dashboard-stats strong { font-size: 26px; }
    body.portal-body .dashboard-stats small { font-size: 11px; }
    body.portal-body .dashboard-hero { gap: 16px; }
    body.portal-auth .portal-grid { grid-template-columns: minmax(0,1fr); gap: 20px; padding-top: 0; }
    body.portal-auth .portal-header { flex-direction: row; flex-wrap: nowrap; align-items: center; }
    body.portal-auth .portal-actions { width: auto; flex-shrink: 0; }
    body.portal-auth .portal-brand strong { max-width: 175px; }
    body.portal-auth .auth-promo { padding: 0; }
    body.portal-auth .auth-promo h1 { font-size: 25px; margin-bottom: 12px; }
    body.portal-auth .auth-promo p { display: none; }
    body.portal-auth .auth-family-image { height: 150px; }
    body.portal-auth .portal-grid > .portal-card:not(.auth-promo) { padding: 20px; }
    body.portal-auth .portal-header .portal-link { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    body.portal-body :is(.portal-link, .portal-button, .admin-mini-button) { transition: none; }
}
.contact-missing-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  margin: 16px 0;
  border-left: 3px solid #a36d12;
  background: #fff8e8;
  color: #684609;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.contact-missing-summary span, .contact-edit-link { text-decoration: underline; }
.contact-missing-badge {
  display: inline-block;
  padding: 3px 8px;
  background: #fff3d6;
  color: #684609;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}
.contact-edit-link { color: #8e172f; font-size: 13px; font-weight: 600; }
.contact-missing-note { margin: 0; padding: 12px; background: #fff8e8; color: #684609; font-size: 13px; }
.customer-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 16px; }
#customer-form { scroll-margin-top: 24px; }
.birthday-page .birthday-page-title { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:24px; }
.birthday-page h1 { font-size:30px; line-height:1.2; margin:4px 0 0; }
.birthday-current-date { font-size:14px; color:#6b6871; white-space:nowrap; }
.birthday-overview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-block:1px solid #e5e1e5; margin-bottom:24px; }
.birthday-overview a { padding:18px 20px; display:flex; justify-content:space-between; align-items:center; gap:10px; text-decoration:none; color:#24202a; border-right:1px solid #e5e1e5; }
.birthday-overview a:last-child { border-right:0; }
.birthday-overview a:hover { background:#f7f5f7; }
.birthday-overview span { font-size:13px; }
.birthday-overview strong { font-size:25px; color:#8e172f; }
.birthday-filter { align-items:end; margin-bottom:20px; }
.birthday-results-heading { display:flex; justify-content:space-between; gap:12px; margin-bottom:12px; font-size:13px; }
.birthday-results-heading span { color:#6b6871; }
.birthday-table-wrap { overflow-x:auto; }
.birthday-table { width:100%; min-width:850px; }
.birthday-table th { font-size:12px; white-space:nowrap; }
.birthday-table td { vertical-align:middle; font-size:13px; }
.birthday-customer-name { color:#24202a; font-weight:700; text-decoration:none; overflow-wrap:anywhere; }
.birthday-customer-name:hover { color:#8e172f; text-decoration:underline; }
.birthday-age { display:block; color:#6b6871; margin-top:3px; }
.birthday-days { white-space:nowrap; }
.birthday-days.near { display:inline-block; color:#8e172f; background:#f5e7eb; border-radius:4px; padding:4px 9px; font-weight:700; }
.birthday-table .birthday-row-soon { background:#faf5f7; }
.birthday-empty { text-align:center; padding:32px!important; color:#6b6871; }
@media(max-width:768px) {
  body.portal-body .birthday-shell .portal-header { gap:14px; margin-bottom:20px; }
  body.portal-body .birthday-shell .portal-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; width:100%; }
  body.portal-body .birthday-shell .portal-actions .portal-link { justify-content:center; text-align:center; padding:9px 5px; font-size:11px; }
  .birthday-page { padding:22px 16px; }
  .birthday-page .birthday-page-title { align-items:flex-start; }
  .birthday-page h1 { font-size:25px; }
  .birthday-current-date { font-size:12px; }
  .birthday-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .birthday-overview a { padding:12px 10px; }
  .birthday-overview a:nth-child(2) { border-right:0; }
  .birthday-overview a:nth-child(-n+2) { border-bottom:1px solid #e5e1e5; }
  .birthday-overview span { font-size:12px; }
  .birthday-overview strong { font-size:22px; }
  .birthday-filter { display:grid; grid-template-columns:1fr 1fr; }
  .birthday-filter label { grid-column:1 / -1; }
  .birthday-table { min-width:0; }
  .birthday-table thead { display:none; }
  .birthday-table tbody,.birthday-table tr { display:block; }
  .birthday-table tr { border-top:1px solid #e5e1e5; padding:10px 0; }
  .birthday-table td { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; border:0; padding:6px 10px; }
  .birthday-table td::before { content:attr(data-label); font-size:12px; color:#6b6871; }
  .birthday-table td:first-child { font-size:15px; padding-bottom:10px; }
  .birthday-table td:first-child::before { display:none; }
  .birthday-table .birthday-age { margin:0; }
  .birthday-table .admin-actions-inline { margin-left:auto; }
}
