/* =========================================================
   SHARED PORTAL FORM COMPONENTS
   Add these to assets/css/form.css.
   These classes are intentionally generic and reusable across
   Categories, Events, Organizers, Venues, Users and other forms.
   ========================================================= */

.portal-section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--brand);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portal-sticky-card {
    position: sticky;
    top: 96px;
    align-self: flex-start;
}

.portal-form-card {
    overflow: hidden;
}

.form-card-heading {
    min-width: 0;
}

.portal-form-actions {
    position: relative;
}

.portal-guide-footer {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.portal-guide-footer-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--brand-50);
    color: var(--brand);
    font-size: 1rem;
}

.portal-guide-footer strong,
.portal-guide-footer span {
    display: block;
}

.portal-guide-footer strong {
    margin-bottom: 3px;
    color: var(--text-head);
    font-size: .82rem;
    font-weight: 800;
}

.portal-guide-footer span {
    color: var(--text-muted);
    font-size: .75rem;
    line-height: 1.55;
}

/* Shared icon input / preview */
.icon-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-preview-box {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--brand-50);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

/* Shared color picker */
.color-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-input {
    width: 48px;
    height: 48px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    cursor: pointer;
}

.color-hex-value {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text-head);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* Shared media/file upload */
.cover-upload-row {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin-top: 6px;
}

.cover-upload-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background:
        linear-gradient(135deg, rgba(80,197,255,.08), rgba(80,197,255,.02)),
        #f8fafc;
}

.cover-upload-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.cover-upload-placeholder {
    color: var(--text-faint);
    font-size: 1.8rem;
    flex-direction: column;
    gap: 5px;
}

.cover-upload-placeholder span {
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 700;
}

.cover-upload-fields {
    min-width: 0;
}

/* Responsive shared behavior */
@media (max-width: 991.98px) {
    .portal-sticky-card {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .cover-upload-row {
        grid-template-columns: 1fr;
    }

    .cover-upload-preview {
        max-width: none;
    }

    .portal-guide-footer {
        margin-top: 15px;
        padding-top: 15px;
    }
}


/* =========================================================
   SHARED PORTAL PROFILE / SHOW PAGE COMPONENTS
   Reusable for Users, Organizers, Speakers, Panelists, etc.
   ========================================================= */

.portal-profile-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.portal-profile-card {
    padding: 22px;
    text-align: left;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    background: var(--surface, #fff);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

/* When paired with .form-guide-card (show-page identity/summary cards),
   the gradient background, brand border, and left-aligned Quick-Guide
   styling take over; these nested cards should not independently stick. */
.portal-profile-aside .form-guide-card,
.event-media-aside .form-guide-card {
    position: static;
}

.portal-media-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: #f4f7fc;
}

.portal-media-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.portal-media-empty {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: var(--r-lg);
    background: #f8fafc;
    color: var(--text-muted);
    text-align: center;
}

.portal-media-empty i {
    color: var(--brand);
    font-size: 2rem;
}

.portal-media-empty strong {
    color: var(--text-head);
    font-size: .88rem;
}

.portal-media-empty-text {
    max-width: 250px;
    color: var(--text-muted);
    font-size: .76rem;
    line-height: 1.5;
}

.portal-identity-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: #f8fafc;
}

.portal-identity-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .12);
}

.portal-identity-icon i {
    line-height: 1;
}

.portal-identity-preview strong,
.portal-identity-preview span {
    display: block;
}

.portal-identity-preview strong {
    color: var(--text-head);
    font-size: .85rem;
}

.portal-identity-preview span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: .72rem;
}

.portal-link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text-head);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.portal-link-item:hover {
    transform: translateX(2px);
    border-color: var(--brand);
    background: var(--brand-50);
    color: var(--brand-deeper);
}

.portal-color-dot {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-block;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--border);
}

.portal-summary-grid {
    margin-top: 22px;
}

.portal-summary-card {
    height: 100%;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.portal-summary-card:hover {
    transform: translateY(-2px);
    border-color: rgba(80, 197, 255, .32);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .07);
}

.portal-summary-card-icon {
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .portal-profile-aside {
        position: sticky;
        top: 96px;
    }
}

@media (max-width: 575.98px) {
    .portal-profile-card {
        padding: 20px 16px;
    }

    .portal-identity-preview {
        align-items: flex-start;
    }

    .portal-profile-avatar {
        width: 88px;
        height: 88px;
    }
}

/* Compact profile-card variant for side panels with limited content.
   Compound selector so this padding still wins once .form-guide-card
   (padding: 24px) is also applied to the same element. */
.portal-profile-card-compact,
.form-guide-card.portal-profile-card-compact {
    padding: 16px;
}

.portal-profile-card-compact .form-guide-badge {
    margin-bottom: 12px;
}

.portal-media-empty-compact {
    min-height: 190px;
    aspect-ratio: auto;
    padding: 22px 20px;
}

.portal-media-empty-compact i {
    margin-bottom: 2px;
    font-size: 1.9rem;
}

.portal-media-empty-compact strong {
    font-size: .9rem;
}

.portal-media-empty-compact .portal-media-empty-text {
    max-width: 260px;
    margin-top: 2px;
}

.portal-profile-card-compact .portal-identity-preview {
    margin-top: 12px;
    padding: 11px 12px;
}

.portal-profile-action {
    min-height: 42px;
    justify-content: center;
    font-size: .8rem;
    font-weight: 800;
}

@media (max-width: 575.98px) {
    .portal-media-empty-compact {
        min-height: 160px;
    }
}

/* =========================================================
   SHARED FORM FIELD COMPONENTS
   Add these to assets/css/form.css.
   ========================================================= */

.portal-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: var(--brand);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.portal-flex-grow {
    flex: 1;
    min-width: 0;
}

.portal-field-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 9px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    font-size: .76rem;
    line-height: 1.5;
}

.portal-field-note i {
    flex-shrink: 0;
    margin-top: 1px;
}

.portal-field-note-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

/* Shared toggle card */
.portal-toggle-card {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.portal-toggle-card:hover {
    border-color: rgba(80, 197, 255, .45);
    background: var(--brand-50);
}

.portal-toggle-copy {
    min-width: 0;
}

.portal-toggle-copy strong,
.portal-toggle-copy span {
    display: block;
}

.portal-toggle-copy strong {
    margin-bottom: 3px;
    color: var(--text-head);
    font-size: .83rem;
    font-weight: 800;
}

.portal-toggle-copy span {
    color: var(--text-muted);
    font-size: .73rem;
    line-height: 1.45;
}

.portal-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex: 0 0 44px;
}

.portal-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.portal-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #d0d5dd;
    transition: background .2s ease;
}

.portal-switch-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .18);
    transition: transform .2s ease;
}

.portal-switch input:checked + .portal-switch-slider {
    background: var(--brand);
}

.portal-switch input:checked + .portal-switch-slider::after {
    transform: translateX(20px);
}

.portal-switch input:focus-visible + .portal-switch-slider {
    outline: 3px solid rgba(80, 197, 255, .2);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .portal-toggle-card {
        min-height: 72px;
        padding: 12px 13px;
    }
}


/* =========================================================
   SHARED SHOW / PROFILE COMPONENT ADDITIONS
   Add to form.css. The portal-profile-* and portal-summary-*
   classes are shared with other modules.
   ========================================================= */

/* Generic visual panel for map/location/media states */
.portal-location-visual {
    min-height: 175px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 18px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background:
        radial-gradient(circle at top right, rgba(80, 197, 255, .12), transparent 55%),
        radial-gradient(circle at bottom left, rgba(80, 197, 255, .08), transparent 55%),
        #f8fafc;
    text-align: center;
}

.portal-location-visual i {
    color: var(--brand);
    font-size: 2.15rem;
}

.portal-location-visual strong {
    color: var(--text-head);
    font-size: .9rem;
    font-weight: 800;
}

.portal-location-visual p {
    max-width: 260px;
    margin: 0;
    color: var(--text-muted);
    font-size: .76rem;
    line-height: 1.5;
}

/* Live preview of a location's map embed (admin location profile) */
.portal-map-preview {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--n-100);
}

.portal-map-preview iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 575.98px) {
    .portal-location-visual {
        min-height: 150px;
        padding: 18px 14px;
    }
}

/* =========================================================
   SHARED SQUARE MEDIA / LOGO UPLOAD COMPONENT
   Add to assets/css/form.css.
   Reusable for organizer logos, user avatars, sponsor logos,
   brand marks, thumbnails, and similar square uploads.
   ========================================================= */

.portal-media-upload-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 6px;
}

.portal-media-upload-preview {
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--brand-50);
}

.portal-media-upload-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.portal-media-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--brand);
    font-size: 1.5rem;
    text-align: center;
}

.portal-media-upload-placeholder span {
    color: var(--text-muted);
    font-size: .68rem;
    font-weight: 700;
}

.portal-media-upload-fields {
    flex: 1;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .portal-media-upload-row {
        flex-direction: column;
    }

    .portal-media-upload-preview {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }
}

.portal-profile-logo {
    width: 100%;
    min-height: 150px;
    margin-bottom: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--brand-50);
}

.portal-profile-logo img {
    width: 100%;
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
}

.portal-detail-value {
    color: var(--text-head);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.55;
    overflow-wrap: anywhere;
}


/* =========================================================
   ORGANIZER SHOW — SOCIAL ICON ROW
   Add to assets/css/form.css.
   The portal-social-* classes can be reused on other profiles.
   ========================================================= */

.portal-social-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.portal-social-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    color: var(--text-head);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.portal-social-title i {
    color: var(--brand);
    font-size: .9rem;
}

.portal-social-icons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-social-icon-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: var(--text-head);
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .035);
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease,
        color .18s ease,
        box-shadow .18s ease;
}

.portal-social-icon-btn:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    background: var(--brand-50);
    color: var(--brand);
    box-shadow: 0 7px 18px rgba(15, 23, 42, .08);
}

.portal-social-icon-btn:focus-visible {
    outline: 3px solid rgba(80, 197, 255, .22);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .portal-social-icons {
        gap: 8px;
    }

    .portal-social-icon-btn {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
}

/* =========================================================
   SHARED AVATAR / CIRCULAR MEDIA UPLOAD COMPONENT
   Add to assets/css/form.css.
   Reusable for users, speakers, panelists, contacts, etc.
   ========================================================= */

.portal-avatar-upload-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 6px;
}

.portal-avatar-upload-preview {
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--brand-50);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.portal-avatar-upload-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.portal-avatar-upload-initials {
    color: var(--brand);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.portal-avatar-upload-fields {
    flex: 1;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .portal-avatar-upload-row {
        flex-direction: column;
    }

    .portal-avatar-upload-preview {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }
}


.portal-profile-avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--brand-50);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
}

.portal-profile-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.portal-profile-avatar span {
    color: var(--brand);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.portal-profile-name {
    margin: 0 0 4px;
    color: var(--text-head);
    font-size: 1.05rem;
    font-weight: 800;
}

.portal-profile-meta {
    margin: 0 0 14px;
    color: var(--default-color);
    font-size: .82rem;
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    .portal-profile-aside {
        position: static;
    }
}




/*
 * ═══════════════════════════════════════════════════════════════════════════
 * EVENTS PORTAL ADMIN - FORM / CREATE / EDIT / DETAIL PAGES
 * form.css · LOAD ONLY ON FORM & DETAIL-VIEW PAGES
 * ───────────────────────────────────────────────────────────────────────────
 * Form-specific rules ONLY. Buttons, badges, modals, dropdowns, stat cards,
 * tokens and the shared summary/filter card all come from styles.css.
 *   1. Form shell + title row     8. Fields / inputs
 *   2. Form layouts               9. Password / input actions
 *   3. Shared card foundation    10. Form actions + footnote
 *   4. Guide card + preview      11. Mini cards / stats
 *   5. Form card                 12. Detail view
 *   6. Form-scoped alerts        13. Previews (cert / image / zoom)
 *   7. Form sections             14. Event overview (image + content, 580px)
 *   15. Event/template helpers   16. Sender cards   17. Responsive
 *   18. Message token toolbar     19. Registration field picker
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════
   1. FORM SHELL + TITLE ROW
   ═══════════════════════════════════════════════════════════════ */
.form-page,
.form-shell {
  background: var(--bg);
}

.form-shell>.container {
  width: 100%;
  max-width: 1800px;
  padding-left: 24px;
  padding-right: 24px;
}

.form-section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.form-section-title {
  flex: 1 1 auto;
  min-width: 0;
}

.form-back-btn {
  flex: 0 0 auto;
  margin-top: 4px;
}

.form-title-actions,
.form-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   2. FORM LAYOUTS
   ───────────────────────────────────────────────────────────────
   .form-layout          guide (left) + form (right)
   .form-detail-layout / .event-detail-layout   sticky aside + content
   ═══════════════════════════════════════════════════════════════ */
.form-layout {
  display: grid;
  grid-template-columns: minmax(290px, 0.82fr) minmax(0, 1.6fr);
  gap: 22px;
  align-items: start;
}

.form-layout-reverse {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.form-single-layout {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.form-detail-layout,
.event-detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.55fr);
  gap: 24px;
  align-items: start;
}

.event-detail-aside,
.form-detail-aside {
  position: sticky;
  top: 90px;
  min-width: 0;
}

.event-detail-main,
.form-detail-main {
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════
   3. SHARED CARD FOUNDATION (form/detail panels)
   ═══════════════════════════════════════════════════════════════ */
.form-guide-card,
.form-card,
.form-mini-card,
.form-section-card,
.form-certificate-preview,
.edit-image-card,
.material-edit-image-card,
.detail-view-item,
.material-detail-item,
.detail-view-text,
.material-detail-text,
.detail-image-card,
.material-detail-image-card {
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════
   4. GUIDE CARD (left column) + preview
   ═══════════════════════════════════════════════════════════════ */
.form-guide-card {
  position: sticky;
  top: 90px;
  padding: 24px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--brand-50) 0%, var(--surface) 100%);
  border-color: var(--brand-200);
}

.form-guide-card::after {
  content: "";
  position: absolute;
  top: -54px;
  right: -42px;
  width: 155px;
  height: 155px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(14, 165, 233, .13) 0%, transparent 70%);
  pointer-events: none;
}

.form-guide-card>* {
  position: relative;
  z-index: 1;
}

.form-guide-badge,
.form-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--brand-100);
  border: 1px solid var(--brand-200);
  color: var(--brand-deeper);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.4;
}

.form-guide-card h3 {
  margin: 16px 0 10px;
  color: var(--text-head);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.form-guide-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.7;
}

.form-guide-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.form-guide-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
  font-size: .85rem;
  line-height: 1.55;
}

.form-guide-item i {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--green);
}

.form-guide-mini-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  margin-top: 10px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--border);
}

.form-guide-mini-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-100);
  color: var(--brand);
}

.form-guide-mini-card h4 {
  margin: 0 0 3px;
  font-size: .875rem;
  font-weight: 800;
  color: var(--text-head);
  line-height: 1.35;
}

.form-guide-mini-card p {
  margin: 0;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.form-guide-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: rgba(14, 165, 233, .06);
  border: 1px solid var(--brand-200);
  color: var(--brand-deeper);
  font-size: .82rem;
  line-height: 1.6;
}

.form-guide-note i {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand);
}

/* preview inside guide/aside */
.form-guide-preview,
.event-card-preview-wrap {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.form-guide-preview img,
.event-card-preview {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
  border-radius: var(--r-lg);
  background: var(--n-50);
}

/* ═══════════════════════════════════════════════════════════════
   5. FORM CARD
   ═══════════════════════════════════════════════════════════════ */
.form-card {
  overflow: hidden;
  background: var(--surface);
}

.form-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface) 0%, var(--n-50) 100%);
}

.form-card-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: var(--r-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand);
  border: 1px solid var(--brand-200);
  font-size: 1.1rem;
}

.form-card-header h3 {
  margin: 8px 0 5px;
  color: var(--text-head);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
}

.form-card-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.65;
}

.form-body {
  padding: 26px;
}

/* ═══════════════════════════════════════════════════════════════
   6. FORM-SCOPED ALERTS
   Clean inset feedback banners for form and page cards
   ═══════════════════════════════════════════════════════════════ */

.form-alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;

  margin: 18px 26px 22px;
  padding: 13px 16px;

  border: 1px solid transparent;
  border-radius: 12px;

  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.55;

  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.03),
    0 5px 14px rgba(15, 23, 42, 0.035);

  overflow: hidden;
}

/* Small emphasis strip on the left */
.form-alert::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: currentColor;
  opacity: 0.7;
}

/* Remove inset margins where required */
.form-alert.mx-0,
.form-alert.no-card-margin {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Icon container */
.form-alert-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 1px;
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.72);
  border: 1px solid currentColor;

  font-size: 0.85rem;
  line-height: 1;
}

.form-alert-icon i {
  margin: 0;
  flex-shrink: 0;
}

/* Alert content */
.form-alert-content {
  min-width: 0;
  flex: 1;
  padding-top: 2px;
}

.form-alert-title {
  display: block;
  margin: 0 0 2px;

  color: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
}

.form-alert-message {
  margin: 0;
  color: inherit;
  opacity: 0.94;
}

/* Validation error list */
.form-alert ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.form-alert li {
  margin-bottom: 3px;
}

.form-alert li:last-child {
  margin-bottom: 0;
}

/* Success */
.form-alert-success {
  color: var(--green-text, #047857);
  background:
    linear-gradient(135deg,
      rgba(236, 253, 245, 0.98),
      rgba(240, 253, 250, 0.96));
  border-color: rgba(16, 185, 129, 0.28);
}

/* Danger */
.form-alert-danger {
  color: var(--red-text, #b91c1c);
  background:
    linear-gradient(135deg,
      rgba(254, 242, 242, 0.98),
      rgba(255, 247, 247, 0.96));
  border-color: rgba(239, 68, 68, 0.28);
}

.form-alert-danger .form-alert-message {
  color: var(--red-text, #b91c1c) !important;
}

/* Warning */
.form-alert-warning,
.form-message-warning {
  color: var(--amber-text, #92400e);
  background:
    linear-gradient(135deg,
      rgba(255, 251, 235, 0.98),
      rgba(255, 247, 237, 0.96));
  border-color: rgba(245, 158, 11, 0.3);
}

/* Information */
.form-alert-info {
  color: var(--brand-deeper, #075985);
  background:
    linear-gradient(135deg,
      rgba(239, 246, 255, 0.98),
      rgba(240, 249, 255, 0.96));
  border-color: var(--brand-200, #bae6fd);
}

/* Optional compact variation */
.form-alert.form-alert-compact {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Mobile */
@media (max-width: 767.98px) {
  .form-alert {
    gap: 10px;
    margin: 0 18px 16px;
    padding: 12px 13px;
    border-radius: 10px;
    font-size: 0.83rem;
  }

  .form-alert-icon {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    border-radius: 7px;
    font-size: 0.78rem;
  }

  .form-alert-title {
    font-size: 0.84rem;
  }
}

@media (max-width: 575.98px) {
  .form-alert {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   7. FORM SECTIONS
   ═══════════════════════════════════════════════════════════════ */
.form-section-card {
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.form-section-card+.form-section-card {
  margin-top: 14px;
}

.form-section-header {
  margin-bottom: 16px;
}

.form-section-header h4 {
  margin: 0 0 4px;
  color: var(--text-head);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.form-section-header h4 span {
  margin-left: 6px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
}

.form-section-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: .83rem;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   8. FIELDS / INPUTS
   ═══════════════════════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.form-grid-full {
  grid-column: 1 / -1;
}

.form-field {
  min-width: 0;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-head);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
}

.form-label span,
.form-label .required-star {
  color: var(--red);
}

.form-input-wrap,
.form-file-wrap {
  position: relative;
}

.form-input-wrap>i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: .9rem;
  pointer-events: none;
}

.form-input-wrap.has-right-icon .form-control-custom {
  padding-right: 48px;
}

.form-control-custom,
.form-textarea,
.form-file-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-head);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: .875rem;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
}

.form-control-custom {
  min-height: 46px;
  padding: 0 14px 0 42px;
  display: flex;
  align-items: center;
}

.form-control-custom.no-icon,
.no-icon {
  padding-left: 14px !important;
}

select.form-control-custom {
  padding-right: 38px;
  cursor: pointer;
}

.form-textarea {
  min-height: 150px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.65;
}

.form-file-input {
  min-height: 46px;
  padding: 10px 12px;
}

.form-control-custom::placeholder,
.form-textarea::placeholder {
  color: var(--text-faint);
}

.form-control-custom:focus,
.form-textarea:focus,
.form-file-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-control-custom:disabled,
.form-textarea:disabled,
.form-file-input:disabled,
.form-control-custom[readonly],
.form-textarea[readonly] {
  background: var(--n-50);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-control-custom.is-invalid,
.form-textarea.is-invalid,
.form-file-input.is-invalid {
  border-color: rgba(239, 68, 68, .55);
}

.form-control-custom.is-invalid:focus,
.form-textarea.is-invalid:focus,
.form-file-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .08);
}

.form-field-error {
  display: none;
  margin-top: 5px;
  font-size: .78rem;
  color: var(--red-dark);
  font-weight: 600;
  line-height: 1.45;
}

.form-field-error.show,
.form-server-error {
  display: block;
}

.form-server-error {
  margin-top: 5px;
  font-size: .78rem;
  color: var(--red-dark);
  font-weight: 600;
  line-height: 1.45;
}

.form-input-help {
  display: block;
  margin-top: 5px;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* textarea with icon wrapper */
.form-textarea-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 130px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  box-shadow: var(--shadow-xs);
}

.form-textarea-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-textarea-wrap>i {
  padding: 15px 0 0 14px;
  color: var(--text-faint);
  font-size: .9rem;
  flex-shrink: 0;
  pointer-events: none;
}

.form-textarea-wrap .form-control-custom,
.form-textarea-wrap .form-textarea,
.form-textarea-wrap textarea {
  flex: 1 1 auto;
  min-height: 130px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  outline: none;
  background: transparent;
  resize: vertical;
  color: var(--text-head);
  font-family: var(--font-sans);
  font-size: .875rem;
  line-height: 1.65;
  box-shadow: none;
}

.form-textarea-wrap.is-invalid-wrap {
  border-color: rgba(239, 68, 68, .55);
}

.form-textarea-wrap.is-invalid-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .08);
}

.form-textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.form-char-counter {
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   9. PASSWORD / INPUT ACTIONS
   ═══════════════════════════════════════════════════════════════ */
.form-password-wrap .form-control-custom {
  padding-right: 48px;
}

.form-password-toggle,
.form-input-action {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand-deeper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.form-password-toggle:hover,
.form-input-action:hover {
  background: var(--brand-100);
  color: var(--brand-dark);
}

/* ═══════════════════════════════════════════════════════════════
   10. FORM ACTIONS + FOOTNOTE
   (button appearance itself lives in styles.css)
   ═══════════════════════════════════════════════════════════════ */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.form-actions-end {
  justify-content: flex-end;
}

.form-actions-between {
  justify-content: space-between;
}

.form-footnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-deeper);
  font-size: .82rem;
  line-height: 1.6;
}

.form-footnote i {
  flex-shrink: 0;
  margin-top: 2px;
}

/* message delivery summary (send-message form) */
.form-message-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .65);
  border: 1px solid var(--border);
}

.form-message-summary>div {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.form-message-summary span {
  display: block;
  margin-bottom: 4px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.form-message-summary strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-head);
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════
   11. MINI CARDS / STATS
   ═══════════════════════════════════════════════════════════════ */
.form-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.form-mini-grid.mb-4 {
  margin-top: 0;
}

.form-mini-card {
  padding: 20px;
  background: var(--surface);
}

.form-mini-card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: var(--r-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand);
  border: 1px solid var(--brand-200);
}

.form-mini-card h4 {
  margin: 0 0 6px;
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-head);
}

.form-mini-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.65;
}

.form-mini-card-value {
  margin: 0 0 4px;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-head);
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════
   12. DETAIL VIEW
   ═══════════════════════════════════════════════════════════════ */
.detail-view-grid,
.material-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-view-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-view-item,
.material-detail-item {
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.detail-view-item--full,
.material-detail-full {
  grid-column: 1 / -1;
}

.detail-view-item span,
.material-detail-item span {
  display: block;
  margin-bottom: 5px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
}

.detail-view-item strong,
.material-detail-item strong {
  display: block;
  font-size: .875rem;
  font-weight: 650;
  color: var(--text-head);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.detail-view-text,
.material-detail-text {
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  line-height: 1.75;
  font-weight: 500;
  color: var(--text-head);
  overflow-wrap: anywhere;
}

/* ═══════════════════════════════════════════════════════════════
   12b. EVENT AGENDA PREVIEW (read-only schedule list on the Event
   show page — full add/edit/delete lives on its own Schedule page)
   ═══════════════════════════════════════════════════════════════ */
.event-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.event-agenda-time {
  flex: 0 0 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}

.event-agenda-time span {
  font-size: .82rem;
  font-weight: 800;
  color: var(--text-head);
}

.event-agenda-time small {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-faint);
}

.event-agenda-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-agenda-content strong {
  font-size: .85rem;
  font-weight: 750;
  color: var(--text-head);
  overflow-wrap: anywhere;
}

.event-agenda-date {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.event-agenda-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.event-agenda-empty i {
  font-size: 1.4rem;
  color: var(--brand);
}

.form-message-preview-clean {
  display: block;
  white-space: pre-wrap;
  line-height: 1.75;
  font-weight: 600 !important;
}

/* ═══════════════════════════════════════════════════════════════
   13. PREVIEWS (certificate / file / image + zoom)
   ═══════════════════════════════════════════════════════════════ */
.form-client-section {
  display: none;
}

.form-client-section.visible {
  display: block;
}

.form-certificate-preview {
  margin: 0 26px 26px;
  padding: 20px;
  background: var(--surface);
}

.form-cert-preview-frame {
  width: 100%;
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.form-cert-img {
  max-height: 500px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
}

.edit-image-grid,
.material-edit-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.edit-image-card,
.material-edit-image-card {
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface);
}

.edit-image-card img,
.material-edit-image-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.edit-image-body,
.material-edit-image-body {
  padding: 12px;
}

.delete-image-check,
.material-delete-image-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--red-50);
  border: 1px solid rgba(239, 68, 68, .2);
  color: var(--red-text);
  font-weight: 700;
  cursor: pointer;
  font-size: .85rem;
}

.delete-image-check input,
.material-delete-image-check input {
  width: 15px;
  height: 15px;
}

.detail-image-grid,
.material-detail-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.detail-image-card,
.material-detail-image-card {
  display: block;
  padding: 0;
  background: var(--surface);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-lg);
  cursor: zoom-in;
}

.detail-image-card img,
.material-detail-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.detail-image-card:hover img,
.material-detail-image-card:hover img {
  transform: scale(1.06);
}

/* zoom lightbox (detail galleries) */
.image-zoom-modal,
.material-image-modal-content {
  position: relative;
  border: 0;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: #000;
}

.image-zoom-modal img,
.material-image-modal-content img {
  width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.image-zoom-close,
.material-image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--text-head);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   14. EVENT OVERVIEW  (card image LEFT ≤580px + content RIGHT)
   Reusable on any view that shows a card image beside details.
   <div class="event-overview-card">
     <div class="event-overview-preview"><img ...></div>
     <div class="event-overview-content"> ... </div>
   </div>
   ═══════════════════════════════════════════════════════════════ */
.event-overview-card {
  display: grid;
  grid-template-columns: 580px minmax(0, 1fr);
  gap: 26px;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.event-overview-preview {
  min-height: 460px;
  border-radius: var(--r-xl);
  background: var(--n-50);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.event-overview-preview img {
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: contain;
  display: block;
  border-radius: var(--r-lg);
}

.event-overview-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.event-overview-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.event-overview-top h3 {
  margin: 0 0 5px;
  color: var(--text-head);
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-display);
  overflow-wrap: anywhere;
}

.event-overview-top p {
  margin: 0;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.65;
}

.event-message-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
}

.event-message-box span {
  display: block;
  margin-bottom: 6px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-deeper);
}

.event-message-box p {
  margin: 0;
  color: var(--text-head);
  font-size: .875rem;
  line-height: 1.7;
  font-weight: 600;
  white-space: pre-wrap;
}

.event-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.event-overview-no-template {
  text-align: center;
  padding: 24px;
}

.event-overview-no-template i {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: var(--r-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand);
  border: 1px solid var(--brand-200);
  font-size: 1.5rem;
}

.event-overview-no-template h4 {
  margin: 0 0 8px;
  color: var(--text-head);
  font-size: 1rem;
  font-weight: 800;
}

.event-overview-no-template p {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   15. EVENT / TEMPLATE PREVIEW HELPERS  (template setup aside)
   ═══════════════════════════════════════════════════════════════ */
.event-template-aside {
  display: flex;
  flex-direction: column;
}

.event-template-preview {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}

.event-template-preview img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border-radius: var(--r-lg);
}

.event-template-meta {
  margin-top: 18px;
}

.event-template-meta h4 {
  margin: 0 0 4px;
  color: var(--text-head);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.event-template-meta p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
   16. SENDER CARDS  (WhatsApp / SMS sender grid)
   ═══════════════════════════════════════════════════════════════ */
.sender-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.sender-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 14px 35px rgba(15, 23, 42, .06);
  transition: .25s ease;
}

.sender-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, .10);
}

.sender-card.is-active {
  border-color: rgba(22, 163, 74, .35);
  background: linear-gradient(180deg, rgba(22, 163, 74, .08), #fff 42%);
}

.sender-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sender-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 197, 255, .14);
  color: #414042;
  font-size: 1.25rem;
}

.sender-card.is-active .sender-icon {
  background: rgba(22, 163, 74, .14);
  color: #16a34a;
}

.sender-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--n-100);
  color: var(--text-muted);
  white-space: nowrap;
}

.sender-status.active {
  background: rgba(22, 163, 74, .12);
  color: #16a34a;
}

.sender-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 800;
  color: #111827;
  letter-spacing: .02em;
}

.sender-card p {
  margin: 0;
  color: #6b7280;
  font-weight: 500;
  line-height: 1.55;
}

.sender-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(15, 23, 42, .14);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6b7280;
  font-size: .84rem;
  font-weight: 600;
}

.sender-actions {
  margin-top: auto;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sender-actions form {
  width: 100%;
}

.sender-actions .form-btn {
  width: 100%;
  justify-content: center;
  min-height: 42px;
  padding: 9px 10px;
  font-size: .82rem;
  font-weight: 700;
}

.sender-actions .form-btn-danger {
  background: #fff5f5;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.sender-actions .form-btn-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.sender-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 55px 20px;
  border: 1px dashed rgba(15, 23, 42, .18);
  border-radius: 22px;
  background: var(--n-50);
}

.sender-empty i {
  font-size: 2.6rem;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.sender-empty h4 {
  font-weight: 800;
  color: #111827;
}

.sender-empty p {
  color: #6b7280;
  margin: 0;
}

.sender-edit-modal .modal-dialog {
  max-width: 620px;
}

.sender-edit-modal .modal-content {
  border: 0;
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(15, 23, 42, .22);
}

.sender-edit-header {
  padding: 24px 28px;
  background: linear-gradient(135deg, #414042, #50c5ff);
  color: #fff;
}

.sender-edit-header h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
}

.sender-edit-header p {
  margin: .35rem 0 0;
  opacity: .9;
}

.sender-edit-body {
  padding: 28px;
}

.sender-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px 28px;
  border-top: 1px solid #eef2f7;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   17. RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Small laptops / large tablets */
@media (max-width: 1399.98px) {
  .event-overview-card {
    grid-template-columns: 460px minmax(0, 1fr);
  }
}

@media (max-width: 1199.98px) {
  .form-shell>.container {
    max-width: 100%;
    padding-left: 28px;
    padding-right: 28px;
  }

  .form-layout {
    grid-template-columns: minmax(270px, 0.85fr) minmax(0, 1.5fr);
    gap: 18px;
  }

  .form-layout-reverse {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  }

  .form-detail-layout,
  .event-detail-layout {
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.45fr);
    gap: 20px;
  }

  .form-guide-card,
  .event-detail-aside,
  .form-detail-aside {
    top: 84px;
  }

  .event-overview-card {
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 20px;
  }

  .event-overview-preview {
    min-height: 400px;
  }
}

/* Tablet */
@media (max-width: 991.98px) {

  .form-layout,
  .form-layout-reverse,
  .form-detail-layout,
  .event-detail-layout {
    grid-template-columns: 1fr;
  }

  .form-guide-card,
  .event-detail-aside,
  .form-detail-aside {
    position: relative;
    top: auto;
  }

  .form-section-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-title-actions,
  .form-section-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .form-back-btn {
    margin-top: 0;
  }

  /* event overview stacks: image on top, centered */
  .event-overview-card {
    grid-template-columns: 1fr;
  }

  .event-overview-preview {
    min-height: auto;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }

  .event-overview-preview img {
    max-height: 620px;
  }

  .event-template-preview,
  .event-template-meta {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .sender-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile landscape / small tablet */
@media (max-width: 767.98px) {

  .form-card-header,
  .form-body {
    padding: 18px;
  }

  .form-card-header {
    flex-direction: column;
  }

  .form-grid,
  .form-grid-3,
  .detail-view-grid,
  .detail-view-grid-3,
  .material-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-view-item--full,
  .material-detail-full,
  .form-grid-full {
    grid-column: auto;
  }

  .event-agenda-item {
    flex-direction: column;
  }

  .event-agenda-time {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }

  .form-mini-grid {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .event-overview-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .form-btn,
  .event-overview-actions .form-btn,
  .form-title-actions .form-btn,
  .form-section-actions .form-btn,
  .form-title-actions form,
  .form-section-actions form {
    width: 100%;
  }

  .form-message-summary {
    grid-template-columns: 1fr;
  }

  .form-textarea-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-overview-top {
    flex-direction: column;
  }
}

/* Small mobile */
@media (max-width: 575.98px) {
  .form-shell>.container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .form-section-title-row {
    gap: 14px;
    margin-bottom: 18px;
  }

  .form-guide-card,
  .form-card,
  .form-mini-card,
  .form-section-card,
  .event-overview-card {
    border-radius: var(--r-xl);
  }

  .form-guide-card,
  .form-mini-card {
    padding: 18px;
  }

  .form-card-header,
  .form-body {
    padding: 16px;
  }

  .form-card-icon {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .form-card-header h3,
  .form-guide-card h3 {
    font-size: 1.18rem;
  }

  .form-section-card {
    padding: 14px;
    border-radius: var(--r-lg);
  }

  .form-control-custom,
  .form-file-input {
    min-height: 44px;
  }

  .edit-image-grid,
  .material-edit-image-grid,
  .detail-image-grid,
  .material-detail-image-grid {
    grid-template-columns: 1fr;
  }

  .form-certificate-preview {
    margin: 0 16px 16px;
    padding: 14px;
  }

  .form-cert-preview-frame {
    min-height: 360px;
  }

  .event-overview-card {
    padding: 16px;
    gap: 18px;
  }

  .event-overview-preview {
    max-width: 100%;
    padding: 10px;
  }

  .event-overview-top h3 {
    font-size: 1.25rem;
  }

  .event-overview-actions .form-btn {
    width: 100%;
  }

  .event-template-preview {
    padding: 10px;
    border-radius: var(--r-lg);
  }

  .event-template-preview img {
    max-height: 520px;
  }

  .sender-grid {
    grid-template-columns: 1fr;
  }

  .sender-actions {
    grid-template-columns: 1fr;
  }

  .sender-actions .form-btn,
  .sender-edit-footer .form-btn {
    width: 100%;
  }

  .sender-edit-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}

/* ═══════════════════════════════════════════════════════════════
   18. MESSAGE TOKEN TOOLBAR
   Insert-token buttons for message/template composer fields.
   ═══════════════════════════════════════════════════════════════ */
.form-token-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.form-token-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.form-token-toolbar-label i {
  color: var(--brand-dark);
  font-size: .85rem;
}

.form-token-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-head);
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    transform var(--t-fast),
    box-shadow var(--t-fast);
}

.form-token-btn i {
  font-size: .82rem;
  color: var(--brand-dark);
  transition: color var(--t-fast);
}

.form-token-btn:hover {
  border-color: var(--brand);
  background: var(--brand-50);
  color: var(--brand-deeper);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.form-token-btn:hover i {
  color: var(--brand-deeper);
}

.form-token-btn:active {
  transform: translateY(0);
  background: var(--brand-100);
}

.form-token-btn:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}

/* Brief highlight on the field a token was just inserted into - visible
   confirmation even if you weren't watching the cursor. Toggled by JS
   via classList.add/remove after each insert; see the updated script
   block in each page. */
@keyframes formTokenFlash {
  0% {
    background-color: var(--brand-soft);
  }

  100% {
    background-color: transparent;
  }
}

.form-token-flash {
  animation: formTokenFlash .7s var(--ease) 1;
}

@media (max-width: 575.98px) {
  .form-token-toolbar {
    gap: 6px;
  }

  .form-token-btn {
    height: 28px;
    padding: 0 10px;
    font-size: .74rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   19. REGISTRATION FIELD PICKER
   Event admin form — checklist of App\Support\RegistrationFieldCatalog
   fields the event's in-app registration form should collect, each
   paired with a "Required" checkbox. Full Name / Phone are locked
   (always collected) and shown as plain badges above the grid.
   ═══════════════════════════════════════════════════════════════ */

.registration-field-picker-locked {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.registration-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.registration-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color .2s ease, background .2s ease;
}

.registration-field-row:has(.js-reg-field-toggle:checked) {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.registration-field-toggle,
.registration-field-required {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--text-head);
  cursor: pointer;
  white-space: nowrap;
}

.registration-field-required {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.registration-field-required:has(input:disabled) {
  opacity: .5;
  cursor: not-allowed;
}

.registration-field-toggle input,
.registration-field-required input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.registration-field-required input:disabled {
  cursor: not-allowed;
}

@media (max-width: 767.98px) {
  .registration-field-grid {
    grid-template-columns: 1fr;
  }

  .registration-field-row {
    flex-wrap: wrap;
  }
}