/* ============================================================
   NSE Oluyole Branch Membership Portal - design system
   ============================================================ */
:root {
    --green: #0b6b3a;
    --green-dark: #084d29;
    --green-soft: #e8f6ee;
    --gold: #c9a227;
    --ink: #1c2321;
    --muted: #67736e;
    --line: #dde5e1;
    --bg: #f2f6f4;
    --white: #ffffff;
    --danger: #b3372f;
    --danger-dark: #8f2b24;
    --warn: #9a6a00;
    --info: #1d5a96;
    --info-bg: #e7f0fa;
    --warn-bg: #fff4dc;
    --ok-bg: #e8f6ee;
    --err-bg: #fdeceb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(16, 42, 30, 0.08), 0 1px 2px rgba(16, 42, 30, 0.04);
    --shadow-lg: 0 10px 32px rgba(16, 42, 30, 0.16);
    --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    font-size: 15.5px;
}

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.55rem; margin: 0.35em 0; }
h2 { font-size: 1.22rem; margin-top: 0; }
h3 { font-size: 1.05rem; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

:focus-visible {
    outline: 3px solid rgba(11, 107, 58, 0.55);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    overflow: hidden; white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 300;
    background: var(--green-dark);
    color: #fff;
    padding: 0.55rem 1rem;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- shell / sidebar / topbar ---------- */
.shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0a5c34 0%, #074526 100%);
    color: #dff0e6;
    z-index: 120;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.sidebar-brand:hover { color: #fff; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 211, 77, 0.5);
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.5px;
    flex: none;
}
.brand-mark-sm { width: 34px; height: 34px; font-size: 0.82rem; border-radius: 8px; }
.brand-logo { max-width: 44px; max-height: 44px; border-radius: 8px; }
.brand-logo-sm { max-width: 34px; max-height: 34px; }
.brand-text { font-weight: 700; font-size: 0.98rem; line-height: 1.25; }
.brand-text small { display: block; font-weight: 400; opacity: 0.82; font-size: 0.74rem; }

.sidebar-nav { flex: 1; padding: 0.6rem 0.75rem 1rem; }
.nav-heading {
    margin: 1rem 0.45rem 0.3rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(223, 240, 230, 0.62);
    font-weight: 700;
}
.nav-group:first-child .nav-heading { margin-top: 0.4rem; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    margin: 0.1rem 0;
    border-radius: var(--radius-sm);
    color: #eaf6ef;
    font-weight: 600;
    font-size: 0.92rem;
    text-align: left;
    transition: background 0.12s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-link[aria-current="page"] {
    background: #fff;
    color: var(--green-dark);
}
.nav-ico { flex: none; width: 1.1em; text-align: center; opacity: 0.85; }
.nav-form { display: contents; }
.nav-link.as-button {
    appearance: none;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
}
.sidebar-foot {
    padding: 0.8rem 1rem;
    font-size: 0.74rem;
    color: rgba(223, 240, 230, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    margin: 0;
}

.main-area {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.55rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.topbar-brand {
    display: none;
    align-items: center;
    gap: 0.55rem;
    color: var(--ink);
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 0;
}
.topbar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}
.topbar-user-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-chip {
    display: inline-block;
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid rgba(11, 107, 58, 0.25);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.05rem 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.role-chip-super_admin { background: var(--green); color: #fff; border-color: var(--green); }
.role-chip-admin { background: var(--info-bg); color: var(--info); border-color: rgba(29, 90, 150, 0.3); }
.role-chip-treasurer { background: var(--warn-bg); color: var(--warn); border-color: rgba(154, 106, 0, 0.3); }

.nav-toggle {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    color: var(--ink);
}
.nav-toggle:hover { background: var(--bg); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 28, 20, 0.5);
    z-index: 110;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.4rem 1rem 3rem;
    flex: 1;
}
.container-narrow { max-width: 720px; }

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.83rem;
    padding: 1.4rem 1rem 1.8rem;
}

.auth-body .footer {
    color: #ffffff;
}

/* guest mode: no sidebar, centered top bar like a public site */
body:has(.sidebar[data-guest]) .shell { display: block; }

/* ---------- cards ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.35rem 1.4rem;
    margin-bottom: 1.2rem;
}

.muted { color: var(--muted); }
.mt { margin-top: 1rem; }
.small { font-size: 0.82rem; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 0.9em; letter-spacing: 0.02em; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}
.section-head h2 { margin: 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.52rem 1.1rem;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    background: #e9efec;
    color: var(--ink);
    transition: filter 0.15s ease, transform 0.05s ease;
    text-align: center;
}
.btn:hover { filter: brightness(0.95); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-primary[disabled], .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); color: #fff; }
.btn-enable { background: var(--green); color: #fff; }
.btn-enable:hover { background: var(--green-dark); color: #fff; }
.btn-outline-danger {
    background: var(--white);
    color: var(--danger);
    border-color: rgba(179, 55, 47, 0.45);
}
.btn-outline-danger:hover { background: var(--err-bg); color: var(--danger-dark); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn-secondary { background: var(--white); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.btn-link {
    background: none;
    border: none;
    color: #eaf6ef;
    font-weight: 600;
    padding: 0;
}
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 1em; height: 1em;
    margin: -0.5em 0 0 -0.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    color: #fff;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-form { display: inline-flex; gap: 0.35rem; align-items: center; margin: 0; }

/* ---------- forms ---------- */
.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.92rem; }
.req-star { color: var(--danger); }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.58rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.96rem;
    font-family: inherit;
    background: #fbfdfc;
    color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: 3px solid rgba(11, 107, 58, 0.35);
    outline-offset: 1px;
    border-color: var(--green);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1rem 1.1rem; margin: 0 0 1rem; }
legend { font-weight: 700; font-size: 0.9rem; padding: 0 0.35rem; }
.check-row { display: flex; align-items: flex-start; gap: 0.5rem; }
.check-row input[type="checkbox"] { width: 1.05rem; height: 1.05rem; margin-top: 0.25rem; flex: none; }
.check-row label { margin: 0; font-weight: 500; }
.field-hint { color: var(--muted); font-size: 0.82rem; margin: 0.3rem 0 0; }
.field-error { color: var(--danger); font-size: 0.85rem; margin: 0.25rem 0 0; font-weight: 600; }

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-card { max-width: 860px; }

/* ---------- alerts ---------- */
.alert {
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.2rem;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
}
.alert::before {
    position: absolute;
    left: 0.9rem;
    top: 0.72rem;
    font-weight: 700;
}
.alert-success { background: var(--ok-bg); color: #14603c; border-color: rgba(20, 96, 60, 0.18); }
.alert-success::before { content: "\2714"; color: #14603c; }
.alert-error { background: var(--err-bg); color: var(--danger); border-color: rgba(179, 55, 47, 0.22); }
.alert-error::before { content: "\2718"; color: var(--danger); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: rgba(154, 106, 0, 0.22); }
.alert-warning::before { content: "\26A0"; color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: rgba(29, 90, 150, 0.2); }
.alert-info::before { content: "\2139"; color: var(--info); }

/* ---------- stats ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}
.stat {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    padding: 1.05rem 0.9rem;
    margin-bottom: 0;
}
.stat-value { display: block; font-size: 1.55rem; font-weight: 700; color: var(--green-dark); margin: 0; }
.stat-label { color: var(--muted); font-size: 0.84rem; }
.stat-accent-warn .stat-value { color: var(--warn); }
.stat-accent-danger .stat-value { color: var(--danger); }
.stat-accent-info .stat-value { color: var(--info); }
.stat-sub { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.91rem; }
.table th, .table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tbody tr:hover { background: #f7faf8; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.members-table { min-width: 1020px; }
.members-table td { vertical-align: middle; }
.th-actions, .td-actions { text-align: right; white-space: nowrap; }
.td-actions .btn + .btn { margin-left: 0.35rem; }
.table-meta { margin: 0 0 0.7rem; font-size: 0.87rem; }
.sort-link { color: inherit; }
.sort-link:hover { color: var(--green); }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- badges & statuses ---------- */
.badge {
    display: inline-block;
    background: #e9efec;
    color: var(--green-dark);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.79rem;
    font-weight: 600;
    font-family: Consolas, monospace;
}
.badge-super { background: var(--green); color: #fff; }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: #eef0f2; color: #55606a; }
.badge-paid { background: var(--ok-bg); color: #14603c; }
.badge-outstanding { background: var(--err-bg); color: var(--danger); }
.perm-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.status-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.13rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-active { background: var(--ok-bg); color: #14603c; }
.status-active::before { content: "\2713 "; }
.status-inactive { background: #eef0f2; color: #55606a; }
.status-inactive::before { content: "\25CB "; }
.status-suspended { background: var(--err-bg); color: var(--danger); }
.status-suspended::before { content: "\2718 "; }

.fin-badge,
.dues-badge,
.txn-badge,
.pay-status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.13rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.badge-fin-up, .badge-success { background: var(--ok-bg); color: #14603c; }
.badge-fin-up::before, .badge-success::before { content: "\2713 "; }
.badge-fin-out, .badge-failed { background: var(--err-bg); color: var(--danger); }
.badge-fin-out::before, .badge-failed::before { content: "\2718 "; }
.badge-fin-none { background: #eef0f2; color: #55606a; }
.badge-fin-inactive { background: #f3ede4; color: #7a5b23; }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-pending::before { content: "\25CF "; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-info::before { content: "\2139 "; }
.badge-neutral { background: #eef0f2; color: #55606a; }
.badge-rejected, .badge-cancelled { background: #efe7ea; color: #7c3a44; }
.badge-refunded { background: var(--info-bg); color: var(--info); }
.credit-text { color: #14603c; font-weight: 700; }
.debit-text { color: var(--danger); font-weight: 700; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.7rem;
    margin: 0.4rem 0 1.2rem;
}
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.95rem 0.6rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--green-dark);
    transition: border-color 0.12s ease, transform 0.08s ease;
}
.quick-action:hover { border-color: var(--green); color: var(--green-dark); transform: translateY(-2px); }
.quick-action .qa-ico {
    font-size: 1.3rem;
    line-height: 1;
    color: var(--gold);
}

/* ---------- hero / home ---------- */
.hero { padding: 2.2rem; }
.hero-sub { font-size: 1.12rem; color: var(--green-dark); font-weight: 600; margin-top: -0.4em; }
.hero-actions { margin-top: 1.2rem; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.feature h3 { margin-top: 0; color: var(--green-dark); }

/* ---------- auth pages ---------- */
.auth-body { background: linear-gradient(160deg, #0a5c34 0%, #0b6b3a 46%, #10794a 100%); min-height: 100vh; display: flex; flex-direction: column; }
.auth-topbar { padding: 0.9rem 1.2rem; }
.auth-brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; }
.auth-brand:hover { color: #fff; }
.auth-main {
    flex: 1;
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
    padding: 1rem 1rem 2.5rem;
}
.auth-panel {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.auth-hero {
    background: linear-gradient(165deg, #074526 0%, #0a5c34 70%);
    color: #ecf7f0;
    padding: 2.2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}
.auth-hero h2 { color: #fff; font-size: 1.45rem; margin: 0; }
.auth-hero p { margin: 0; color: rgba(236, 247, 240, 0.88); font-size: 0.95rem; }
.auth-hero-logo { display: block; width: 300px; height: auto; object-fit: contain; margin: 0 auto 0.8rem auto; }
.auth-contact { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.88rem; }
.auth-contact li { padding: 0.22rem 0; display: flex; gap: 0.5rem; }
.auth-contact a { color: var(--gold); word-break: break-all; }
.auth-form-side { padding: 2.2rem 2rem; }
.auth-wrap { display: flex; justify-content: center; padding: 1rem 0; }
.auth-card { width: 100%; max-width: 420px; }
.auth-alt { text-align: center; margin-top: 1rem; font-size: 0.92rem; }
.hint { color: var(--muted); font-size: 0.82rem; margin: 0.3rem 0 0; }

/* ---------- install wizard ---------- */
.install-header { text-align: center; margin: 1.2rem 0; }
.install-header .brand-mark { margin-bottom: 0.5rem; }
.steps {
    list-style: none;
    display: flex;
    justify-content: space-between;
    padding: 0;
    margin: 0 0 1.2rem;
    counter-reset: step;
}
.steps li {
    flex: 1;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    position: relative;
    padding-top: 1.6rem;
}
.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dbe5df;
    color: var(--muted);
    font-weight: 700;
    line-height: 26px;
    font-size: 0.8rem;
}
.steps li.active { color: var(--green-dark); font-weight: 600; }
.steps li.active::before { background: var(--green); color: #fff; }
.req-list { list-style: none; padding: 0; margin: 0.3rem 0 1rem; }
.req-list li { padding: 0.3rem 0 0.3rem 1.6rem; position: relative; }
.req-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.req-list li.ok::before { background: #23a45c; }
.req-list li.warn::before { background: #e2a400; }
.req-list li.fail::before { background: var(--danger); }
.manual-env textarea { font-family: Consolas, monospace; font-size: 0.85rem; white-space: pre; overflow: auto; }

/* ---------- error pages ---------- */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(160deg, #0a5c34 0%, #0b6b3a 55%, #10794a 100%);
}
.error-card { text-align: center; max-width: 520px; width: 100%; }
.error-code {
    font-size: 4rem;
    font-weight: 800;
    margin: 0;
    color: var(--green-dark);
    line-height: 1;
    letter-spacing: -0.02em;
}
.error-title { font-size: 1.15rem; margin: 0.6rem 0 0.2rem; }
.error-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.1rem; }
.debug-box {
    text-align: left;
    background: #f6f2ee;
    padding: 0.8rem;
    border-radius: 8px;
    overflow: auto;
    max-height: 320px;
    font-size: 0.78rem;
}

/* ---------- avatars / member summary ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: #dfe9e3; display: block; }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 64px; height: 64px; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-xl { width: 128px; height: 128px; }
.member-summary { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.member-name { margin-bottom: 0.15em; }
.member-nse { margin: 0 0 0.4rem; color: var(--green-dark); }

.detail-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    row-gap: 0.45rem;
    margin: 0;
}
.detail-grid dt { color: var(--muted); font-weight: 600; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }

.placeholder-card h3 { margin-top: 0; color: var(--muted); }
.section-note { color: var(--muted); font-size: 0.88rem; margin-top: 1.4rem; }

/* ---------- filters ---------- */
.filter-bar { padding: 1rem 1.2rem; }
.filter-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.filter-form .form-group { margin-bottom: 0; min-width: 150px; }
.filter-grow { flex: 1 1 240px; }
.filter-buttons { display: flex; gap: 0.5rem; }
.inline-form input[type="text"], .inline-form input[type="date"] {
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; gap: 0.3rem; margin-top: 1rem; flex-wrap: wrap; }
.page-num {
    display: inline-block;
    min-width: 34px;
    text-align: center;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
}
.page-num:hover { border-color: var(--green); color: var(--green); }
.page-current { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.page-ellipsis { color: var(--muted); }
.page-info { color: var(--muted); font-size: 0.84rem; margin-left: 0.4rem; }

/* ---------- empty states ---------- */
.empty-state {
    text-align: center;
    padding: 2.4rem 1rem;
    color: var(--muted);
}
.empty-state .es-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    font-size: 1.5rem;
    margin-bottom: 0.7rem;
}
.empty-state .es-title { font-weight: 700; color: var(--ink); margin: 0 0 0.25rem; }
.empty-state .es-hint { font-size: 0.88rem; margin: 0 0 0.9rem; }

/* ---------- modals ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 28, 20, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 200;
}
.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    width: 100%;
    padding: 1.4rem 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title { margin: 0 0 0.5rem; font-size: 1.1rem; }
.modal-body { color: var(--ink); font-size: 0.94rem; margin: 0 0 1.1rem; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }
.modal-overlay[hidden] { display: none !important; }

/* ---------- newsletter media modal ---------- */
.media-modal { max-width: 620px; }
.media-tabs { display: flex; gap: 0.5rem; margin: 0 0 0.9rem; flex-wrap: wrap; }
.media-tabs .btn.active { background: var(--forest, #14532d); color: #fff; }
.media-panel { display: none; }
.media-tabs + .media-panel { display: block; }
.media-panel input[type="file"] { margin: 0.4rem 0 0.6rem; display: block; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; max-height: 40vh; overflow-y: auto; }
.media-grid-page { max-height: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.media-item { border: 1px solid #e2e0da; border-radius: 8px; height: 84px; background-color: #f4f2ed; background-position: center; background-size: cover; background-repeat: no-repeat; cursor: pointer; transition: border-color 0.15s ease; }
.media-grid-page .media-item { height: 120px; width: 100%; }
.media-item:hover, .media-item:focus-visible { border-color: var(--forest, #14532d); }
.media-item:empty { background-image: none; }
.media-tile { display: flex; flex-direction: column; gap: 0.4rem; }
.media-tile-actions { text-align: center; }
.media-tile-actions .btn { width: 100%; }
.media-tile .btn-danger { background: var(--danger); color: #fff; }

/* embed placeholder card shown inside the composer editor */
.editor-area div[data-embed-type] {
    margin: 10px 0;
    padding: 10px;
    border: 1px dashed #b9a45b;
    border-radius: 8px;
    background: #fbf8ef;
    font-family: Arial, Helvetica, sans-serif;
}
.editor-area div[data-embed-type] .nse-embed-label {
    display: block;
    color: #7a6120;
    font-weight: 600;
}

/* ---------- misc legacy + phase 6 ---------- */
.photo-editor { display: flex; align-items: flex-start; gap: 1.4rem; flex-wrap: wrap; }
.photo-form input[type="file"] { margin-bottom: 0.5rem; }
.import-form input[type="file"] { margin-bottom: 0.75rem; }
.error-list { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: 0.85rem; }
.error-list li { padding: 0.1rem 0; }
.ok-text { color: #14603c; }
.err-text { color: var(--danger); }
.dues-totals .stat-value { margin: 0; font-size: 1.15rem; font-weight: 700; }
.pay-details { display: inline-block; position: relative; vertical-align: top; }
.pay-details summary { list-style: none; cursor: pointer; display: inline-block; }
.pay-details summary::-webkit-details-marker { display: none; }
.pay-details[open] summary { opacity: 0.75; }
.pay-form { flex-wrap: wrap; }
.refund-option { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; white-space: nowrap; }
.queue-strip { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.queue-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--green-soft); font-size: 0.85rem; }
.fee-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fee-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--surface-2, #f1f5f2); border: 1px solid rgba(11,107,58,0.18); font-size: 0.8rem; white-space: nowrap; }
.editor-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.editor-toolbar button, .editor-toolbar select {
    border: 1px solid #d7dee8; background: #fff; border-radius: 6px;
    padding: 5px 10px; font-size: 0.85rem; cursor: pointer; min-width: 34px;
}
.editor-toolbar button:hover, .editor-toolbar select:hover { background: #f1f5f9; }
.editor-image-bar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin: 8px 0 0; padding: 8px 10px; border: 1px solid #c9a227;
    border-radius: 8px; background: #fbf9f1; font-size: 0.85rem;
}
.editor-image-bar[hidden] { display: none !important; }
.editor-image-bar-label { font-weight: 600; color: #14532d; }
.editor-image-bar-sep { width: 1px; align-self: stretch; background: #e2e0da; }
.editor-image-bar .btn { padding: 4px 10px; font-size: 0.8rem; }
.editor-image-bar .btn.active { background: var(--forest, #14532d); color: #fff; }
.editor-image-bar select { padding: 4px 6px; border: 1px solid #d7dee8; border-radius: 6px; font-size: 0.85rem; }
.editor-area {
    min-height: 260px; border: 1px solid #d7dee8; border-radius: 8px;
    padding: 14px 16px; background: #fff; overflow-y: auto;
    font-size: 15px; line-height: 1.55;
}
.editor-area:focus { outline: 2px solid rgba(201, 162, 39, 0.45); border-color: #c9a227; }
.editor-area h1, .editor-area h2, .editor-area h3 { margin: 0.6em 0 0.3em; line-height: 1.25; }
.editor-area p { margin: 0 0 0.6em; }
.editor-area img { max-width: 100%; height: auto; }
.editor-area a { color: #b8860b; }
.editor-source { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; white-space: pre-wrap; }
.member-pick-list {
    max-height: 260px; overflow-y: auto; border: 1px solid #d7dee8;
    border-radius: 8px; padding: 10px 12px; background: #fff;
}
.member-pick { display: flex; align-items: center; gap: 8px; padding: 4px 2px; cursor: pointer; }
.mail-preview-frame { width: 100%; min-height: 420px; border: 1px solid #d7dee8; border-radius: 8px; background: #eef2f7; }
.composer-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* report hub cards */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}
.report-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.2rem;
    color: var(--ink);
    transition: border-color 0.12s ease, transform 0.08s ease;
}
.report-card:hover { border-color: var(--green); color: var(--ink); transform: translateY(-2px); }
.report-card h3 { margin: 0; color: var(--green-dark); }
.report-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }

.sys-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.6rem; }
.sys-status-item {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: baseline;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    background: #fbfdfc;
    font-size: 0.88rem;
}
.sys-status-item dt { color: var(--muted); font-weight: 600; }
.sys-status-item dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
    display: flex;
    gap: 0.7rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.89rem;
    align-items: baseline;
    flex-wrap: wrap;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-time { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

@media print {
    .sidebar, .topbar, .footer, .page-actions, .no-print, .skip-link { display: none !important; }
    .main-area { margin-left: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ccc; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: none;
    }
    .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-area { margin-left: 0; }
    .topbar-brand { display: flex; }
    .auth-panel { grid-template-columns: 1fr; }
    .auth-hero { padding: 1.6rem 1.5rem; }
    .auth-form-side { padding: 1.6rem 1.5rem; }
}

@media (max-width: 640px) {
    body { font-size: 15px; }
    .container { padding: 1rem 0.8rem 2.4rem; }
    .card { padding: 1.05rem 1rem; }
    .hero { padding: 1.5rem 1.2rem; }
    .form-row { flex-direction: column; gap: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; row-gap: 0.1rem; }
    .detail-grid dt { margin-top: 0.5rem; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions .btn { flex: 1 1 auto; }
    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-form .form-group { min-width: 0; }
    .steps li { font-size: 0.72rem; }
    .topbar-user-name { display: none; }
    .table { font-size: 0.86rem; }
    .modal-overlay { padding: 0.6rem; }
}
.danger-zone-card { border-color: #dc3545 !important; }
.danger-zone-card h2 { color: #dc3545; }
.danger-list, .safe-list { margin: 0.5rem 0 1rem; padding-left: 1.3rem; }
.danger-list li { margin-bottom: 0.3rem; }
.safe-list li { margin-bottom: 0.3rem; }
.reset-confirm-form { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.reset-input { max-width: 320px; }
