:root {
    --ep-soft: #f5f7fb;
}
body { background: var(--ep-soft); }
.page-wrap { padding-top: 24px; padding-bottom: 40px; max-width: 1400px; }
.card { border: 0; border-radius: 18px; box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08); }
.card-header { border-radius: 18px 18px 0 0 !important; }
.btn { border-radius: 10px; }
.form-control, .form-select { border-radius: 10px; }
.form-control-lg, .form-select-lg { min-height: 48px; }
.table thead th { white-space: nowrap; }
.stat-card { min-height: 120px; }
.stat-number { font-size: 2rem; font-weight: 800; }
.ticket-card { max-width: 520px; margin: 0 auto; border: 2px dashed #1f2937; background: white; }
.ticket-title { letter-spacing: 0.14em; font-weight: 800; }
.qr-box { min-height: 240px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px; }
.profile-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 1px solid #ddd; }
.profile-photo-lg { width: 120px; height: 120px; object-fit: cover; border-radius: 18px; border: 1px solid #ddd; }
.copy-input { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.85rem; }
.scanner-box { background: #111827; border-radius: 18px; padding: 12px; color: #fff; }
#reader video { border-radius: 12px; }
.profile-hero { background: linear-gradient(135deg, #ffffff, #f8fafc); }
.ticket-summary-card { border-left: 5px solid #111827; }
.event-mini-logo { width: 58px; height: 58px; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid #e5e7eb; padding: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.event-pass { border-radius: 24px; border: 1px solid #d1d5db; background: #fff; }
.bp-top-strip { height: 12px; background: #111827; }
.event-pass-inner { padding: 28px; }
.bp-kicker { text-transform: uppercase; letter-spacing: .18em; font-weight: 800; font-size: .78rem; color: #6b7280; }
.bp-event-name { font-weight: 900; font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.05; }
.bp-logo { max-height: 82px; max-width: 220px; object-fit: contain; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 8px; }
.bp-section { border: 1px solid #e5e7eb; border-radius: 18px; padding: 20px; background: #f9fafb; }
.bp-label { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: #6b7280; font-weight: 800; margin-bottom: 4px; }
.bp-value { font-weight: 800; font-size: 1.08rem; color: #111827; }
.bp-small { font-weight: 600; color: #374151; word-break: break-word; }
.bp-qr-panel { border: 2px dashed #111827; border-radius: 20px; padding: 18px; text-align: center; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.bp-photo { width: 78px; height: 78px; object-fit: cover; border-radius: 18px; border: 1px solid #d1d5db; margin-bottom: 12px; }
.bp-footer { border-top: 1px dashed #d1d5db; padding-top: 16px; color: #4b5563; font-size: .92rem; }

@media (max-width: 767.98px) {
    .page-wrap { padding: 12px 10px 28px; }
    .navbar-brand { font-size: 1rem; }
    .card { border-radius: 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); }
    .card-body { padding: 16px !important; }
    .registration-card .card-body { padding: 16px !important; }
    .mobile-form .form-label { font-weight: 700; margin-bottom: 6px; }
    .mobile-form .form-control, .mobile-form .form-select { font-size: 1rem; min-height: 50px; }
    .mobile-form textarea.form-control { min-height: 105px; }
    .mobile-form .btn, .action-bar-mobile .btn { width: 100%; }
    .action-bar-mobile { width: 100%; }
    .mobile-copy-group { display: block; }
    .mobile-copy-group > .form-control,
    .mobile-copy-group > .btn { width: 100%; border-radius: 10px !important; margin-bottom: 8px; }
    .stat-number { font-size: 1.55rem; }
    .table { font-size: .9rem; }
    .profile-photo-lg { width: 88px; height: 88px; }
    .event-pass { border-radius: 18px; }
    .event-pass-inner { padding: 16px; }
    .bp-section { padding: 14px; }
    .bp-logo { max-width: 160px; max-height: 64px; }
    .bp-qr-panel { padding: 14px; }
    .bp-event-name { font-size: 1.65rem; }
}

@media print {
    .navbar, .no-print, .btn, .alert { display: none !important; }
    body { background: #fff; }
    .page-wrap { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .ticket-card { page-break-inside: avoid; }
    .event-pass { border: 1px solid #111827 !important; box-shadow: none !important; }
    .event-pass-inner { padding: 18px; }
    .bp-top-strip { background: #111827 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .bp-section { background: #fff !important; }
    .bp-qr-panel { min-height: 320px; }
    .badge { border: 1px solid #111827; color: #111827 !important; background: #fff !important; }
}

/* V1.3 Scanner + Attendance Control + Reports Polish */
.scan-page .scanner-card { overflow: hidden; }
.scan-selected-event { border-radius: 16px; }
.profile-photo-xl { width: 148px; height: 148px; object-fit: cover; border-radius: 24px; border: 1px solid #d1d5db; }
.scan-result-card { background: #fff; border: 2px solid #e5e7eb; border-radius: 24px; overflow: hidden; box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08); }
.scan-result-top { padding: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.scan-kicker { text-transform: uppercase; letter-spacing: .16em; font-weight: 800; font-size: .78rem; opacity: .85; }
.scan-title { font-size: clamp(1.9rem, 5vw, 3.4rem); font-weight: 900; line-height: .98; }
.scan-message { font-size: 1.08rem; font-weight: 600; opacity: .95; }
.scan-status-pill .badge { font-size: 1rem; padding: .6rem .8rem; }
.scan-result-body { padding: 24px; }
.attendee-name { font-size: clamp(1.55rem, 4vw, 2.35rem); font-weight: 900; line-height: 1.05; color: #111827; }
.scan-info-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 16px; padding: 14px; min-height: 82px; }
.checkin-table th { width: 150px; color: #4b5563; }
.checkin-primary-btn { min-width: 220px; font-size: 1.25rem; font-weight: 800; }
.event-health-box { border: 1px solid #e5e7eb; border-radius: 18px; padding: 16px; background: #f9fafb; }
.event-health-number { font-size: 2rem; font-weight: 900; color: #111827; }
.report-count { border: 1px solid #e5e7eb; border-radius: 16px; padding: 12px; background: #f9fafb; display: flex; flex-direction: column; gap: 2px; }
.report-count strong { font-size: 1.6rem; line-height: 1; }
.report-count span { color: #6b7280; font-size: .86rem; font-weight: 700; }
.signature-cell { min-width: 160px; height: 42px; }
.report-table th, .report-table td { vertical-align: middle; }

@media (max-width: 767.98px) {
    .scan-result-top { padding: 18px; display: block; }
    .scan-status-pill { margin-top: 12px; }
    .scan-result-body { padding: 16px; }
    .profile-photo-xl { width: 108px; height: 108px; margin-bottom: 10px; }
    .checkin-primary-btn { width: 100%; min-width: 0; }
    .scan-page .scanner-box { padding: 8px; }
    #reader { min-height: 280px; }
    .event-health-number { font-size: 1.65rem; }
    .report-count strong { font-size: 1.3rem; }
}

@media print {
    .report-event-card { border: 0 !important; }
    .report-table { font-size: 9pt; }
    .signature-cell { min-width: 130px; height: 38px; }
    .progress { display: none !important; }
}

/* V1.5 Registrant Profile Portal Polish */
.profile-tabs .nav-link { border-radius: 999px; font-weight: 700; }
.profile-detail-box { border: 1px solid #e5e7eb; border-radius: 16px; background: #f9fafb; padding: 14px; min-height: 86px; }
.profile-detail-list { display: grid; gap: 10px; }
.profile-detail-list div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eef2f7; padding-bottom: 8px; }
.profile-detail-list span { color: #6b7280; font-size: .86rem; font-weight: 700; }
.profile-detail-list strong { color: #111827; text-align: right; word-break: break-word; }
.profile-request-card { border-left: 5px solid #f59e0b; }
.profile-diff-table td, .profile-diff-table th { vertical-align: middle; }

@media (max-width: 767.98px) {
    .profile-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .profile-tabs .nav-link { white-space: nowrap; }
    .profile-detail-list div { display: block; }
    .profile-detail-list strong { display: block; text-align: left; margin-top: 2px; }
}

/* V1.7 Public Event Listing + Invite Management */
.public-event-card { border-radius: 22px; overflow: hidden; box-shadow: 0 10px 28px rgba(15, 23, 42, .07); }
.public-event-logo-wrap { height: 120px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; padding: 18px; border-bottom: 1px solid #e5e7eb; }
.public-event-logo-wrap img { max-height: 86px; max-width: 100%; object-fit: contain; }
.invite-check { transform: scale(1.2); }
@media (max-width: 767.98px) {
    .public-event-logo-wrap { height: 96px; }
}

/* V1.9 Dashboard Analytics + Event Monitoring */
.analytics-card { position: relative; overflow: hidden; }
.analytics-card::after { content: ""; position: absolute; right: -26px; bottom: -26px; width: 80px; height: 80px; background: rgba(17,24,39,.05); border-radius: 999px; }
.attention-card { border-left: 5px solid #f59e0b; }
.danger-card { border-left: 5px solid #dc3545; }
.dashboard-panel { min-height: 230px; }
.dashboard-mini-progress { height: 7px; margin-top: 5px; border-radius: 999px; }
.performance-table td, .performance-table th { vertical-align: middle; }
.timeline-bucket-title { text-transform: uppercase; letter-spacing: .12em; font-weight: 900; font-size: .78rem; color: #6b7280; margin-bottom: 8px; }
.timeline-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.capacity-pill { min-width: 72px; height: 42px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; font-weight: 900; }
.capacity-warn { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.capacity-full { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.event-monitor-card .event-health-number { font-size: 1.8rem; }
@media (max-width: 767.98px) {
    .dashboard-stats-grid .stat-card { min-height: 94px; }
    .dashboard-panel { min-height: auto; border-right: 0 !important; }
    .timeline-item { display: block; }
    .timeline-actions { justify-content: flex-start; margin-top: 10px; }
    .timeline-actions .btn { width: 100%; }
    .performance-table { font-size: .86rem; }
}

/* V2.1 Branding + Organization Settings */
:root {
    --brand-primary: #0f172a;
    --brand-secondary: #0ea5e9;
    --brand-button: #0d6efd;
    --brand-header: #111827;
}
.brand-navbar { background: var(--brand-header) !important; }
.nav-brand-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; }
.brand-preview-logo { max-width: 220px; max-height: 92px; object-fit: contain; border: 1px solid #e5e7eb; border-radius: 14px; padding: 8px; background: #fff; }
.brand-hero { background: linear-gradient(135deg, rgba(14,165,233,.12), rgba(15,23,42,.04)); border: 1px solid #e5e7eb; border-radius: 24px; overflow: hidden; }
.brand-hero-logo { max-height: 96px; max-width: 260px; object-fit: contain; background: #fff; border-radius: 18px; padding: 10px; border: 1px solid #e5e7eb; }
.btn-primary { background-color: var(--brand-button); border-color: var(--brand-button); }
.btn-outline-primary { color: var(--brand-button); border-color: var(--brand-button); }
.btn-outline-primary:hover { background-color: var(--brand-button); border-color: var(--brand-button); color: #fff; }
.text-primary { color: var(--brand-button) !important; }
.bp-top-strip { background: var(--brand-primary); }
.event-pass { border-top: 5px solid var(--brand-secondary); }
.report-brand-logo { max-height: 72px; max-width: 240px; object-fit: contain; }
.report-brand-header { border-bottom: 2px solid var(--brand-primary); padding-bottom: 12px; margin-bottom: 14px; }
.footer-brand-text { color: #6b7280; font-size: .88rem; }
@media print {
    .report-brand-header { display: flex !important; }
    .report-brand-logo { max-height: 58px; }
}

/* V2.2 Certificate of Attendance */
.certificate-sheet {
    border: 0;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
}
.certificate-border {
    position: relative;
    margin: 14px;
    padding: 48px 56px;
    min-height: 760px;
    border: 8px double var(--brand-primary);
    overflow: hidden;
}
.certificate-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: 800;
    color: rgba(15, 23, 42, .035);
    transform: rotate(-18deg);
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}
.certificate-header { text-align: center; position: relative; z-index: 1; }
.certificate-logo { max-height: 96px; max-width: 260px; object-fit: contain; margin-bottom: 18px; }
.certificate-org { text-transform: uppercase; letter-spacing: 3px; color: #6b7280; font-weight: 700; font-size: .85rem; }
.certificate-header h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2rem, 5vw, 4rem); color: var(--brand-primary); font-weight: 700; margin: 12px 0 30px; }
.certificate-presented { text-align: center; color: #6b7280; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; margin-top: 28px; }
.certificate-name { text-align: center; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.2rem, 6vw, 4.8rem); color: #111827; line-height: 1.05; margin: 12px 0 26px; }
.certificate-body { max-width: 850px; margin: 0 auto 34px; text-align: center; font-size: 1.25rem; line-height: 1.8; color: #374151; }
.certificate-details { position: relative; z-index: 1; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 18px; padding: 14px; margin: 24px 0 44px; }
.certificate-bottom { position: relative; z-index: 1; margin-top: 42px; }
.certificate-signature-line { width: 260px; max-width: 100%; border-top: 2px solid #111827; margin-bottom: 10px; }
.certificate-verify-qr { padding: 8px; border: 1px solid #e5e7eb; background: #fff; border-radius: 14px; }
@media (max-width: 767px) {
    .certificate-border { padding: 28px 18px; min-height: auto; margin: 8px; border-width: 5px; }
    .certificate-body { font-size: 1.05rem; }
    .certificate-watermark { font-size: 44px; white-space: normal; }
}
@media print {
    .certificate-sheet { box-shadow: none !important; border: 0 !important; }
    .certificate-border { min-height: 92vh; margin: 0; }
    .certificate-verify-qr { break-inside: avoid; }
}

/* V3.2 Public Portal Polish + Registrant Self-Service */
.public-hero {
    background: linear-gradient(135deg, #ffffff, #eef5ff);
    border: 1px solid rgba(15, 23, 42, 0.06);
}
.public-hero-copy { max-width: 760px; }
.public-hero-logo-wrap {
    width: 180px;
    height: 180px;
    border-radius: 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.public-hero-logo-wrap.small-logo { width: 130px; height: 130px; border-radius: 22px; }
.public-hero-logo-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
.public-step-card { border: 1px solid rgba(15, 23, 42, 0.06); }
.public-step-number {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--brand-button);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-bottom: 12px;
}
.public-event-card-v32 { overflow: hidden; border: 1px solid rgba(15, 23, 42, 0.06); }
.public-event-logo-bar {
    min-height: 92px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-bottom: 1px solid #eef2f7;
}
.public-event-logo-bar img { max-height: 72px; max-width: 180px; object-fit: contain; }
.public-event-meta {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    background: #f9fafb;
    font-size: .92rem;
}
.public-filter-card { border: 1px solid rgba(15, 23, 42, 0.06); }
.public-register-logo {
    max-width: 150px;
    max-height: 82px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 8px;
}
.public-registration-hero { background: linear-gradient(135deg, #ffffff, #eef5ff); }
.success-top-strip { height: 12px; background: var(--brand-button); }
.success-icon { font-size: 3.4rem; }
.public-profile-request-page .card,
.public-register-page .card,
.public-events-page .card,
.public-home-page .card { overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .public-hero-logo-wrap { width: 110px; height: 110px; border-radius: 20px; padding: 14px; }
    .public-hero-logo-wrap.small-logo { width: 96px; height: 96px; }
    .public-hero .display-5 { font-size: 2rem; }
    .public-hero .display-6 { font-size: 1.75rem; }
    .public-hero .btn-lg,
    .public-register-page .btn-lg,
    .public-profile-request-page .btn-lg { width: 100%; }
    .public-register-logo { max-width: 110px; max-height: 64px; }
}

/* V3.3 POPIA / Data Privacy polish */
.privacy-consent-box {
    border-color: rgba(15, 23, 42, 0.12) !important;
}
.privacy-consent-box .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
}
.profile-diff-table td {
    vertical-align: top;
}
