/* ============================================================
   ChurchMeeting — Royal Navy & Gold Theme
   Fonts : Libre Baskerville (headings) · Jost (body)
   Primary  : #1A3A6B  (Navy)
   Accent   : #C9A84C  (Gold)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Jost:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --navy:           #1A3A6B;
    --navy-dark:      #122850;
    --navy-light:     #2A4F8F;
    --navy-muted:     #E8EDF5;
    --gold:           #C9A84C;
    --gold-dark:      #A8883A;
    --gold-light:     #E2C97E;
    --white:          #FFFFFF;
    --off-white:      #F7F8FC;
    --text-primary:   #1A2A45;
    --text-muted:     #6B7A99;
    --border-color:   #D4DAEA;
    --shadow-sm:      0 2px 8px rgba(26,58,107,.08);
    --shadow-md:      0 4px 20px rgba(26,58,107,.12);
    --shadow-lg:      0 8px 40px rgba(26,58,107,.16);
    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      16px;
    --transition:     all .2s ease;
}

/* ── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Jost', 'Sarabun', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--off-white);
    -webkit-font-smoothing: antialiased;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Libre Baskerville', 'Sarabun', serif;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
    letter-spacing: .01em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: .95rem; }

.page-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.6rem;
    color: var(--navy);
    font-weight: 700;
    border-left: 4px solid var(--gold);
    padding-left: .75rem;
    margin-bottom: 1.5rem;
}

a { color: var(--navy-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-dark); }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%) !important;
    padding: .6rem 1.25rem;
    box-shadow: 0 2px 12px rgba(26,58,107,.35);
    border-bottom: 2px solid var(--gold);
}

.navbar-brand {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white) !important;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.navbar-brand i { color: var(--gold); font-size: 1.2rem; }
.navbar-brand:hover { color: var(--gold-light) !important; }

.navbar-nav .nav-link {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: .9rem;
    color: rgba(255,255,255,.85) !important;
    padding: .4rem .85rem;
    border-radius: var(--radius-sm);
    letter-spacing: .03em;
    transition: var(--transition);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--white) !important;
    background-color: rgba(201,168,76,.2);
}

.navbar-text {
    font-size: .88rem;
    font-weight: 500;
    color: rgba(255,255,255,.9) !important;
    letter-spacing: .02em;
}
.navbar-text i { color: var(--gold-light); margin-right: .3rem; }

/* ── Navbar Dropdown — Navy theme ── */
.dropdown-menu-navy {
    background-color: var(--navy-dark);
    border: 1px solid rgba(201,168,76,.3);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(18,40,80,.4);
    padding: .4rem;
    min-width: 200px;
    margin-top: .35rem !important;
}

    .dropdown-menu-navy .dropdown-item {
        font-family: 'Jost', sans-serif;
        font-size: .88rem;
        font-weight: 500;
        color: rgba(255,255,255,.8);
        border-radius: var(--radius-sm);
        padding: .5rem .85rem;
        transition: var(--transition);
        display: flex;
        align-items: center;
    }

        .dropdown-menu-navy .dropdown-item:hover {
            background-color: rgba(201,168,76,.18);
            color: var(--white);
        }

        .dropdown-menu-navy .dropdown-item.active {
            background-color: rgba(201,168,76,.25);
            color: var(--gold-light);
            font-weight: 600;
        }

.navbar-nav .nav-link.dropdown-toggle::after {
    border-top-color: rgba(255,255,255,.7);
}
/* ── Language Switcher — Navbar (dark bg) ───────────────────── */
.btn-group .btn-lang {
    font-family: 'Jost', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    border-color: rgba(201,168,76,.6);
    color: rgba(255,255,255,.8);
    padding: .2rem .6rem;
    transition: var(--transition);
}
.btn-group .btn-lang:hover {
    background-color: rgba(201,168,76,.25);
    color: var(--white);
    border-color: var(--gold-light);
}
.btn-group .btn-lang.active {
    background-color: var(--gold);
    border-color: var(--gold);
    color: var(--navy-dark);
    font-weight: 700;
}

/* ── Language Switcher — white bg (login / register) ────────── */
.btn-lang-page {
    font-family: 'Jost', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    border: 1.5px solid var(--border-color);
    background-color: transparent;
    color: var(--text-muted);
    padding: .2rem .65rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    line-height: 1.5;
}
.btn-lang-page:hover {
    border-color: var(--navy);
    color: var(--navy);
    background-color: var(--navy-muted);
}
.btn-lang-page.active {
    background-color: var(--gold);
    border-color: var(--gold);
    color: var(--navy-dark);
    font-weight: 700;
}

/* ── Language Classes ──────────────────────────────────────── */
body.lang-en .th { display: none !important; }
body.lang-en .en { display: inline !important; }
body.lang-th .en { display: none !important; }
body.lang-th .th { display: inline !important; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--white);
    transition: box-shadow .25s ease, transform .25s ease;
    /* overflow: hidden เอาออก—ทำให้ dropdown panel บังไม่ได้ */
}
/* ลบ transform ออก — สร้าง stacking context ทำให้ position:fixed ติดอยู่ใน card */
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    font-weight: 700;
    padding: .9rem 1.25rem;
    border-bottom: 2px solid var(--gold);
    letter-spacing: .02em;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}
.card-header i { color: var(--gold-light); margin-right: .4rem; }

.card-body { padding: 1.5rem; }
.card-footer {
    background-color: var(--navy-muted);
    border-top: 1px solid var(--border-color);
    padding: .85rem 1.25rem;
}
.card-accent { border-top: 4px solid var(--gold); }

.card-stat { text-align: center; padding: 1.5rem 1rem; }
.card-stat .stat-number {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}
.card-stat .stat-label {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: .875rem;
    letter-spacing: .04em;
    border-radius: var(--radius-sm);
    padding: .45rem 1.1rem;
    transition: var(--transition);
    border-width: 1.5px;
}
.btn-primary { background-color: var(--navy); border-color: var(--navy); color: var(--white); }
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--navy-dark); border-color: var(--navy-dark); color: var(--white);
    box-shadow: 0 4px 14px rgba(26,58,107,.3);
}
.btn-secondary { background-color: var(--gold); border-color: var(--gold); color: var(--navy-dark); }
.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--gold-dark); border-color: var(--gold-dark); color: var(--navy-dark);
    box-shadow: 0 4px 14px rgba(201,168,76,.35);
}
.btn-outline-primary { border-color: var(--navy); color: var(--navy); }
.btn-outline-primary:hover { background-color: var(--navy); color: var(--white); }
.btn-outline-secondary { border-color: var(--gold); color: var(--gold-dark); }
.btn-outline-secondary:hover { background-color: var(--gold); color: var(--navy-dark); }
.btn-outline-light { border-color: rgba(255,255,255,.55); color: var(--white); }
.btn-outline-light:hover { background-color: rgba(255,255,255,.15); color: var(--white); border-color: var(--white); }
.btn-danger, .btn-warning, .btn-success { border-radius: var(--radius-sm); }

/* ── Tables ────────────────────────────────────────────────── */
.table {
    font-size: .9rem;
    border-collapse: collapse;
    border-spacing: 0;
    --bs-table-bg: var(--white);
}
.table thead th {
    background: var(--navy);
    color: var(--white);
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: .85rem 1rem;
    border: none;
    vertical-align: middle;
}
.table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; border-left: 3px solid var(--gold); }
.table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.table tbody tr { transition: background-color .15s ease; }
.table tbody tr:hover { background-color: var(--navy-muted) !important; }
.table tbody td {
    padding: .75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.table-striped > tbody > tr:nth-of-type(odd) > td { background-color: rgba(26,58,107,.03); }
.table-hover tbody tr:hover > td { background-color: var(--navy-muted); }
.table-wrapper {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-label {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: .83rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .3rem;
}
.form-control, .form-select {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Jost', sans-serif;
    font-size: .9rem;
    color: var(--text-primary);
    background-color: var(--white);
    padding: .5rem .85rem;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(26,58,107,.12);
    outline: none;
}
.form-control::placeholder { color: #b0b8cc; font-weight: 400; }
.form-control.is-valid   { border-color: #2e7d52; }
.form-control.is-invalid { border-color: #b0271e; }
.input-group-text {
    background-color: var(--navy-muted);
    border-color: var(--border-color);
    color: var(--navy);
    font-weight: 600;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: .73rem;
    letter-spacing: .05em;
    padding: .35em .7em;
    border-radius: 4px;
}
.badge.bg-primary   { background-color: var(--navy) !important; }
.badge.bg-secondary { background-color: var(--gold) !important; color: var(--navy-dark) !important; }
.badge.bg-gold      { background-color: var(--gold) !important; color: var(--navy-dark) !important; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-md);
    font-size: .9rem;
    border-left-width: 4px;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
}
.alert-primary { background-color: var(--navy-muted); border-color: var(--navy); color: var(--navy-dark); }
.alert-warning { background-color: #fdf8ec; border-color: var(--gold); color: #7a5c10; }
.alert-danger  { border-left-color: #b0271e; }
.alert-success { border-left-color: #2e7d52; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { gap: .2rem; }
.page-link {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: .85rem;
    color: var(--navy);
    border-color: var(--border-color);
    border-radius: var(--radius-sm) !important;
    padding: .4rem .75rem;
    transition: var(--transition);
}
.page-link:hover { background-color: var(--navy-muted); border-color: var(--navy); color: var(--navy-dark); }
.page-item.active .page-link { background-color: var(--navy); border-color: var(--navy); color: var(--white); }

/* ── Modals ────────────────────────────────────────────────── */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    border-bottom: 2px solid var(--gold);
    padding: 1rem 1.5rem;
}
.modal-header .modal-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
}
.modal-header .btn-close { filter: invert(1) brightness(2); }
.modal-body   { padding: 1.75rem 1.5rem; }
.modal-footer { background-color: var(--navy-muted); border-top: 1px solid var(--border-color); padding: .9rem 1.5rem; }

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
    padding: 1rem;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.login-card-header {
    background: var(--navy);
    padding: 1.4rem 1.5rem;
    text-align: center;
    border-bottom: 3px solid var(--gold);
}
.login-card-header i { font-size: 2.2rem; color: var(--gold); margin-bottom: .5rem; display: block; }
.login-card-header h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.3rem;
    color: var(--white);
    margin: 0;
}
.login-logo-panel {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: .65rem .8rem;
    box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.login-brand-logo {
    display: block;
    width: 100%;
    max-height: 132px;
    object-fit: contain;
}
.login-card-body { padding: 2rem; }

/* ══════════════════════════════════════════════════════════════
   REGISTER PAGE — Balanced 40/60 split-screen
   ══════════════════════════════════════════════════════════════ */
.register-wrapper {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
}

/* ── Left branding panel: 40% on desktop ───────────────────── */
.register-panel-left {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem;
    text-align: center;
    border-right: 1px solid rgba(201,168,76,.3);
    position: relative;
    overflow: hidden;
}

/* subtle radial glow behind icon */
.register-panel-left::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(201,168,76,.08) 0%, transparent 70%);
    pointer-events: none;
}

.register-panel-left .brand-icon {
    font-size: 5rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    display: block;
    position: relative;
}

.register-brand-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    background: var(--white);
    border-radius: 50%;
    padding: .55rem;
    margin-bottom: 1.35rem;
    box-shadow: 0 12px 30px rgba(0,0,0,.22);
    position: relative;
}

.register-panel-left h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.55rem;
    color: var(--white);
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 1rem;
    position: relative;
}

.register-panel-left .gold-line {
    width: 52px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 2px;
    margin: 0 auto 1.25rem;
    position: relative;
}

.register-panel-left p {
    font-size: .9rem;
    color: rgba(255,255,255,.6);
    line-height: 1.75;
    margin-bottom: 2rem;
    max-width: 280px;
    position: relative;
}

/* Feature bullets on the left panel */
.register-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2.25rem;
    text-align: left;
    position: relative;
}
.register-feature-list li {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .85rem;
    color: rgba(255,255,255,.75);
    margin-bottom: .6rem;
    font-weight: 400;
}
.register-feature-list li i {
    color: var(--gold);
    font-size: 1rem;
    flex-shrink: 0;
}

.register-panel-left .back-link {
    font-size: .85rem;
    font-weight: 500;
    color: rgba(255,255,255,.75);
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: var(--radius-sm);
    padding: .5rem 1.25rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    position: relative;
}
.register-panel-left .back-link:hover {
    color: var(--white);
    border-color: var(--gold);
    background-color: rgba(201,168,76,.15);
}

/* ── Right form panel: 60% on desktop ──────────────────────── */
.register-panel-right {
    flex: 0 0 60%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 100vh;
}

.register-form-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3.5rem;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.register-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.register-top-bar h2 {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.4rem;
    color: var(--navy);
    margin: 0;
    font-weight: 700;
}

/* Compact spacing — fits without scrolling on 1024+ screens */
.register-form-inner .gold-divider     { margin: .65rem 0; }
.register-form-inner .section-heading  { margin-bottom: .5rem; font-size: .82rem; padding-bottom: .3rem; }
.register-form-inner .row.g-3          { --bs-gutter-y: .45rem; }
.register-form-inner .form-label       { margin-bottom: .15rem; font-size: .78rem; }
.register-form-inner .form-control,
.register-form-inner .form-select      { padding: .32rem .7rem; font-size: .85rem; }
.register-form-inner .input-group-text { padding: .32rem .7rem; }
.register-form-inner .mt-4             { margin-top: .7rem !important; }
.register-form-inner .btn              { padding: .38rem 1rem; font-size: .85rem; }
.register-form-inner small,
.register-form-inner .small            { font-size: .73rem; }
.register-form-inner .mb-1             { margin-bottom: .25rem !important; }

/* ── Large screen refinement (1280px+) ─────────────────────── */
@media (min-width: 1280px) {
    .register-panel-left  { flex: 0 0 38%; padding: 4rem; }
    .register-panel-right { flex: 0 0 62%; }
    .register-form-inner  { padding: 3rem 4rem; max-width: 720px; }

    /* slightly more breathing room on big screens */
    .register-form-inner .gold-divider    { margin: .8rem 0; }
    .register-form-inner .row.g-3         { --bs-gutter-y: .5rem; }
    .register-form-inner .form-control,
    .register-form-inner .form-select     { padding: .38rem .8rem; }
    .register-form-inner .input-group-text{ padding: .38rem .8rem; }
}

/* ── Dividers & Decorators ─────────────────────────────────── */
.gold-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1.5rem 0;
    opacity: .7;
}

.section-heading {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.15rem;
    color: var(--navy);
    font-weight: 700;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-navy  { color: var(--navy)       !important; }
.text-gold  { color: var(--gold)       !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-navy       { background-color: var(--navy)       !important; color: var(--white); }
.bg-navy-muted { background-color: var(--navy-muted) !important; }
.bg-gold       { background-color: var(--gold)       !important; color: var(--navy-dark); }

.shadow-navy { box-shadow: var(--shadow-md); }

/* ── Scrollbar (Webkit) ────────────────────────────────────── */
::-webkit-scrollbar        { width: 7px; height: 7px; }
::-webkit-scrollbar-track  { background: var(--navy-muted); }
::-webkit-scrollbar-thumb  { background: var(--navy-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .register-panel-left  { flex: 0 0 36%; padding: 2.5rem 2rem; }
    .register-panel-right { flex: 0 0 64%; }
    .register-form-inner  { padding: 2rem 2.5rem; }
    .register-panel-left h1 { font-size: 1.25rem; }
    .register-panel-left .brand-icon { font-size: 3.5rem; }
    .register-brand-logo { width: 130px; height: 130px; }
}

@media (max-width: 768px) {
    /* Navbar */
    .navbar-brand { font-size: .95rem; }

    /* Typography */
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }

    /* Cards */
    .card-body { padding: 1rem; }

    /* Tables */
    .table { font-size: .82rem; }
    .table tbody td,
    .table thead th { padding: .6rem .7rem; }

    /* Register: stack on mobile */
    .register-wrapper     { flex-direction: column; }

    .register-panel-left {
        flex: none;
        width: 100%;
        padding: 1.5rem 1.25rem;
        border-right: none;
        border-bottom: 2px solid var(--gold);
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }
    .register-panel-left::before           { display: none; }
    .register-panel-left .brand-icon       { font-size: 2rem; margin-bottom: 0; }
    .register-brand-logo                   { width: 58px; height: 58px; margin-bottom: 0; padding: .2rem; }
    .register-panel-left h1                { font-size: 1rem; margin-bottom: 0; }
    .register-panel-left .gold-line,
    .register-panel-left p,
    .register-feature-list,
    .register-panel-left .back-link        { display: none; }

    .register-panel-right { flex: none; width: 100%; min-height: auto; }
    .register-form-inner  { padding: 1.25rem 1rem; justify-content: flex-start; }
    .register-top-bar     { margin-bottom: 1rem; padding-bottom: .75rem; }
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR LAYOUT
   ══════════════════════════════════════════════════════════════ */
:root { --sidebar-w: 240px; }

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w, 240px);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 60%, #1e4080 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    border-right: 1px solid rgba(201,168,76,.18);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .8rem .75rem .7rem;
    border-bottom: 1px solid rgba(201,168,76,.2);
    text-decoration: none;
    background: rgba(255,255,255,.98);
}

.sidebar-brand-icon {
    font-size: 1.8rem;
    color: var(--gold);
    flex-shrink: 0;
    line-height: 1;
}

.sidebar-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--white);
    border: 1.5px solid rgba(201,168,76,.85);
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.sidebar-brand-logo-wide {
    display: block;
    width: 100%;
    max-width: 210px;
    height: 74px;
    object-fit: contain;
}

.sidebar-brand-text {
    font-family: 'Libre Baskerville', serif;
    font-size: .76rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.35;
    letter-spacing: .01em;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: .75rem .65rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

/* Single link */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .85rem;
    border-radius: var(--radius-md);
    font-family: 'Jost', sans-serif;
    font-size: .875rem;
    font-weight: 500;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.sidebar-link i {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: rgba(201,168,76,.15);
    color: var(--white);
}

.sidebar-link.active {
    background-color: rgba(201,168,76,.22);
    color: var(--gold-light);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--gold);
}

/* Group (accordion) */
.sidebar-group { display: flex; flex-direction: column; }

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .55rem .85rem;
    border-radius: var(--radius-md);
    font-family: 'Jost', sans-serif;
    font-size: .875rem;
    font-weight: 500;
    color: rgba(255,255,255,.75);
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    white-space: nowrap;
}

.sidebar-group-toggle:hover {
    background-color: rgba(201,168,76,.15);
    color: var(--white);
}

.sidebar-group-toggle.open {
    background-color: rgba(201,168,76,.12);
    color: var(--gold-light);
}

.sidebar-group-toggle i { font-size: 1.05rem; width: 20px; text-align: center; }

/* Chevron animation */
.sidebar-chevron {
    font-size: .75rem !important;
    width: auto !important;
    transition: transform .25s ease;
    opacity: .7;
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar-group-toggle.open .sidebar-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Sub-items */
.sidebar-group-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s ease, opacity .25s ease;
    opacity: 0;
    padding-left: .5rem;
}

.sidebar-group-items.show {
    max-height: 400px;
    opacity: 1;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .45rem .85rem .45rem 1rem;
    border-radius: var(--radius-md);
    font-family: 'Jost', sans-serif;
    font-size: .83rem;
    font-weight: 400;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    transition: var(--transition);
    margin-top: .15rem;
    border-left: 2px solid rgba(201,168,76,.2);
}

.sidebar-sublink i {
    font-size: .95rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.sidebar-sublink:hover {
    background-color: rgba(201,168,76,.12);
    color: var(--white);
    border-left-color: rgba(201,168,76,.5);
}

.sidebar-sublink.active {
    background-color: rgba(201,168,76,.18);
    color: var(--gold-light);
    font-weight: 600;
    border-left-color: var(--gold);
}

/* Footer */
.sidebar-footer {
    padding: .75rem .65rem 1rem;
    border-top: 1px solid rgba(201,168,76,.15);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem .85rem;
    border-radius: var(--radius-md);
    font-family: 'Jost', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-logout i { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-logout:hover {
    background-color: rgba(220,53,69,.2);
    color: #f8a9ae;
}

/* Section label */
.sidebar-label {
    font-family: 'Jost', sans-serif;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    padding: .75rem .85rem .25rem;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    height: 56px;
    box-shadow: var(--shadow-sm);
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--navy);
    cursor: pointer;
    padding: .2rem .4rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
}

.topbar-toggle:hover { background-color: var(--navy-muted); }

.topbar-title {
    font-family: 'Libre Baskerville', serif;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Language switcher inside topbar */
.lang-switch {
    display: flex;
    gap: 3px;
}

/* User info */
.topbar-user {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.topbar-user-button {
    background: transparent;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    padding: .25rem .35rem;
    border-radius: var(--radius-md);
    color: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-user-button:hover,
.topbar-user-button.show,
.topbar-user-button:focus,
.topbar-user-button:focus-visible,
.topbar-user-button:active {
    background: var(--navy-muted);
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.topbar-user-button::after {
    margin-left: .25rem;
    color: var(--text-muted);
}

.topbar-user-menu .dropdown-divider {
    border-top-color: rgba(201,168,76,.25);
    margin: .35rem 0;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--gold-light);
    font-family: 'Libre Baskerville', serif;
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--gold);
    letter-spacing: .03em;
}

.topbar-user-name {
    font-family: 'Jost', sans-serif;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.topbar-user-role {
    font-size: .72rem;
    color: var(--text-muted);
    line-height: 1;
}

/* ── Main area ───────────────────────────────────────────────── */
.main-area {
    margin-left: var(--sidebar-w, 240px);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* ── Sidebar overlay (mobile) ────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18,40,80,.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }

/* ── Sidebar responsive ──────────────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(18,40,80,.35);
    }
    .main-area {
        margin-left: 0;
    }
    .topbar-toggle {
        display: flex;
    }
    .topbar-title {
        display: block;
    }
    .page-content {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .topbar-user-info { display: none; }
    .topbar { padding: 0 .75rem; }
    .page-content { padding: .75rem; }
}

/* ══════════════════════════════════════════════════════════════
   CHURCH PHOTO SLOTS
   ══════════════════════════════════════════════════════════════ */
.pic-slot {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.pic-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--navy-muted);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s;
}

.pic-preview:hover { border-color: var(--navy-light); }

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

.pic-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 500;
}

.pic-placeholder i {
    font-size: 1.75rem;
    color: var(--border-color);
}

.pic-remove-btn {
    position: absolute;
    top: .35rem;
    right: .35rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(176,39,30,.85);
    border: none;
    color: #fff;
    font-size: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    line-height: 1;
}

.pic-remove-btn:hover { background: #b0271e; transform: scale(1.1); }

.pic-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .35rem .6rem;
    border: 1.5px solid var(--navy-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--navy);
    font-family: 'Jost', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.pic-upload-label:hover {
    background: var(--navy);
    color: var(--white);
}

.pic-file-input { display: none; }

/* ══════════════════════════════════════════════════════════════
   USER PROFILE PHOTO
   ══════════════════════════════════════════════════════════════ */
.user-pic-wrapper {
    width: 120px;
    height: 160px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 3px solid var(--gold);
    background: var(--navy-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

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

.user-pic-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
}

.user-pic-placeholder i {
    font-size: 3.5rem;
    color: var(--border-color);
}
