/* =====================================================================
   Meetcross Church CMS — Design System
   Palette sampled directly from the Meetcross logo (deep blue + cyan),
   paired with a warm gold accent. Used across both the Super Admin
   panel and (later) the church-facing app for visual consistency.
   ===================================================================== */

:root {
    /* Brand */
    --navy:        #16244A;   /* darkest — sidebar background */
    --navy-2:      #1E3566;   /* sidebar hover / secondary panels */
    --blue:        #3861B1;   /* primary actions, links */
    --blue-light:  #4676CB;   /* hover state for primary */
    --cyan:        #29B6EF;   /* secondary accent, active nav, highlights */
    --gold:        #F0A93E;   /* CTA accent, highlights, warnings */
    --gold-dark:   #D4901F;

    /* Surfaces */
    --bg:          #F3F6FB;
    --surface:     #FFFFFF;
    --border:      #E3E8F1;
    --border-soft: #EEF1F7;

    /* Text */
    --text:        #1B2436;
    --text-muted:  #67728C;
    --text-faint:  #97A1B8;
    --text-on-dark: #E7ECF7;
    --text-on-dark-muted: #93A0C2;

    /* Status */
    --success:     #21A366;
    --success-bg:  #E7F8EF;
    --warning:     #D4901F;
    --warning-bg:  #FDF3E2;
    --danger:      #D8493E;
    --danger-bg:   #FCEAE8;
    --info-bg:     #E9F2FE;

    /* Shape / motion */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(22, 36, 74, 0.06);
    --shadow:    0 2px 10px rgba(22, 36, 74, 0.07);
    --shadow-lg: 0 12px 32px rgba(22, 36, 74, 0.12);
    --transition: 150ms ease;

    --sidebar-width: 248px;
    --header-height: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 4px 0; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; }
p { margin: 0 0 12px 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-light); text-decoration: underline; }

.muted { color: var(--text-muted); font-size: 13px; }
.faint { color: var(--text-faint); font-size: 12px; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
button, .btn {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 9px 16px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}
button:active, .btn:active { transform: translateY(1px); }

button, .btn-primary {
    background: var(--blue);
    color: #fff;
}
button:hover, .btn-primary:hover { background: var(--blue-light); }

.btn-gold {
    background: var(--gold);
    color: #3A2708;
}
.btn-gold:hover { background: #f3b657; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); border-color: var(--text-faint); }

.btn-cyan {
    background: var(--cyan);
    color: #fff;
}
.btn-cyan:hover { background: #4FC6F2; }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #F3CFCB;
}
.btn-danger:hover { background: #f9dcd9; }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-link { background: none; border: none; color: var(--blue); padding: 0; font-weight: 500; }
.btn-link:hover { background: none; color: var(--blue-light); text-decoration: underline; }
.btn-link-danger { background: none; border: none; color: var(--danger); padding: 0; font-weight: 500; cursor: pointer; font-size: 13px; }
.btn-link-danger:hover { background: none; color: var(--danger); text-decoration: underline; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], input[type=url], select, textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(56, 97, 177, 0.14);
}
input[type=checkbox], input[type=radio] {
    width: auto;
    margin-right: 6px;
    accent-color: var(--blue);
}

/* ---------------------------------------------------------------------
   Cards / panels
   --------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }

/* ---------------------------------------------------------------------
   Alerts
   --------------------------------------------------------------------- */
.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13.5px;
    border: 1px solid transparent;
}
.alert-error   { background: var(--danger-bg);  color: #97302A; border-color: #F3CFCB; }
.alert-success { background: var(--success-bg); color: #185E3D; border-color: #BFE9D3; }
.alert-warning { background: var(--warning-bg); color: #7A5514; border-color: #F3DBAE; }
.alert-info    { background: var(--info-bg);    color: #204C87; border-color: #CBE0FB; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-card table { margin: 0; }

/* ---------------------------------------------------------------------
   Badges (status pills)
   --------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}
.badge-active    { background: var(--success-bg); color: var(--success); }
.badge-trial     { background: var(--info-bg);    color: var(--blue); }
.badge-suspended { background: var(--warning-bg); color: var(--warning); }
.badge-cancelled { background: var(--danger-bg);  color: var(--danger); }

/* ---------------------------------------------------------------------
   Stat cards (dashboard)
   --------------------------------------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.stat-card .stat-sub {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 4px;
}
.stat-card.accent-blue .stat-value { color: var(--blue); }
.stat-card.accent-gold .stat-value { color: var(--gold-dark); }
.stat-card.accent-cyan .stat-value { color: #1590B8; }
.stat-card.accent-success .stat-value { color: var(--success); }

/* ---------------------------------------------------------------------
   Chart panels
   --------------------------------------------------------------------- */
.chart-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) {
    .chart-grid { grid-template-columns: 1fr; }
}
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.chart-card canvas { max-height: 240px; }

/* ---------------------------------------------------------------------
   Admin app shell (sidebar + header)
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: var(--text-on-dark);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img { height: 30px; width: auto; display: block; }
.sidebar-brand .brand-name { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: -0.01em; }
.sidebar-brand .brand-tag { font-size: 10px; color: var(--text-on-dark-muted); letter-spacing: 0.06em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-on-dark-muted); padding: 14px 12px 6px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-on-dark-muted);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
    transition: background var(--transition), color var(--transition);
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: rgba(41, 182, 239, 0.16); color: #fff; }
.sidebar-nav a.active .nav-icon { color: var(--cyan); }
.sidebar-nav a.nav-locked { opacity: 0.62; }
.sidebar-nav a.nav-locked:hover { opacity: 0.85; }
.sidebar-nav .nav-crown { width: 15px; height: 15px; color: var(--gold); flex-shrink: 0; }
.sidebar-nav .nav-crown svg { width: 100%; height: 100%; }
.sidebar-nav .nav-icon { width: 17px; height: 17px; flex-shrink: 0; display: inline-flex; }
.sidebar-nav .nav-icon svg { width: 100%; height: 100%; }

/* Groups expandable submenu (native details/summary, no JS) */
.nav-group summary { list-style: none; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text-on-dark-muted); font-size: 13.5px; font-weight: 500;
    margin-bottom: 2px; transition: background var(--transition), color var(--transition);
}
.nav-group summary:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-group summary.active { background: rgba(41, 182, 239, 0.16); color: #fff; }
.nav-group .nav-chevron { width: 13px; height: 13px; flex-shrink: 0; transition: transform var(--transition); }
.nav-group[open] .nav-chevron { transform: rotate(90deg); }
.nav-submenu { padding-left: 30px; margin-bottom: 4px; }
.nav-submenu a {
    display: block; padding: 7px 12px; border-radius: var(--radius-sm);
    color: var(--text-on-dark-muted); font-size: 13px; text-decoration: none;
    margin-bottom: 1px; transition: background var(--transition), color var(--transition);
}
.nav-submenu a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-submenu a.sub-active { background: rgba(41, 182, 239, 0.16); color: #fff; }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer a { color: var(--text-on-dark-muted); font-size: 13px; }
.sidebar-footer a:hover { color: #fff; }

.main-area { margin-left: var(--sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   User menu (topbar avatar dropdown) — native <details>/<summary>, no JS
   --------------------------------------------------------------------- */
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: border-color var(--transition), background var(--transition);
}
.user-menu-trigger:hover { background: var(--bg); border-color: var(--text-faint); }
.user-menu[open] .user-menu-trigger { border-color: var(--cyan); background: var(--info-bg); }
.user-menu-trigger .chevron {
    width: 14px; height: 14px;
    color: var(--text-faint);
    transition: transform var(--transition);
}
.user-menu[open] .user-menu-trigger .chevron { transform: rotate(180deg); color: var(--blue); }
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 30;
}
.user-menu-dropdown a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
}
.user-menu-dropdown a:hover { background: var(--bg); text-decoration: none; }
.user-menu-divider { height: 1px; background: var(--border-soft); margin: 6px 2px; }

.page-content { padding: 26px 28px 40px; max-width: 1200px; width: 100%; }

/* ---------------------------------------------------------------------
   Auth screens (login pages — no sidebar)
   --------------------------------------------------------------------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, #eaf1fc 0%, var(--bg) 55%);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
}
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 22px; }
.auth-logo img { height: 52px; width: auto; margin-bottom: 10px; }
.auth-logo .auth-title { font-size: 17px; font-weight: 700; color: var(--text); text-align: center; }
.auth-logo .auth-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; text-align: center; }

/* ---------------------------------------------------------------------
   Module grid (tenant dashboard) — Shepherdly-style feature tiles
   --------------------------------------------------------------------- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
}
.module-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.module-card .module-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--info-bg);
    color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.module-card .module-icon svg { width: 20px; height: 20px; }
.module-card .module-name { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.module-card .module-desc { font-size: 12px; color: var(--text-muted); }
.module-card.locked { background: var(--bg); }
.module-card.locked .module-icon { background: var(--warning-bg); color: var(--gold-dark); }
.module-card .crown-badge {
    position: absolute; top: 14px; right: 14px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--warning-bg);
    color: var(--gold-dark);
    display: flex; align-items: center; justify-content: center;
}
.module-card .crown-badge svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------------
   Upgrade required page
   --------------------------------------------------------------------- */
.upgrade-card {
    max-width: 480px;
    margin: 40px auto;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow);
}
.upgrade-crown {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--warning-bg);
    color: var(--gold-dark);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.upgrade-crown svg { width: 30px; height: 30px; }

/* ---------------------------------------------------------------------
   Progress bars (plan usage on dashboard)
   --------------------------------------------------------------------- */
.usage-bar { height: 6px; border-radius: 3px; background: var(--border-soft); overflow: hidden; margin-top: 8px; }
.usage-bar-fill { height: 100%; background: var(--blue); border-radius: 3px; }
.usage-bar-fill.warn { background: var(--gold); }
.usage-bar-fill.danger { background: var(--danger); }


/* ---------------------------------------------------------------------
   Person editor form (sectioned card, matches Member add/edit screen)
   --------------------------------------------------------------------- */
.person-form-section {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-soft);
}
.person-form-section:last-child { border-bottom: none; }
.person-form-section h3 {
    margin-bottom: 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--blue);
    text-transform: none;
    letter-spacing: 0;
}
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 4px 18px;
    align-items: start;
}
.field-grid .field-wide { grid-column: span 2; }
.field-grid label { font-size: 12.5px; }

.input-icon-group { display: flex; align-items: stretch; margin-bottom: 16px; }
.input-icon-group .icon-box {
    width: 40px;
    flex-shrink: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.input-icon-group .icon-box svg { width: 16px; height: 16px; }
.input-icon-group input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.form-actions button {
    flex: 1;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
}
.btn-save { background: var(--success); }
.btn-save:hover { background: #279e6c; }
.btn-save-add { background: var(--blue); }
.btn-save-add:hover { background: var(--blue-light); }
.btn-form-cancel { background: #6B7280; color: #fff; }
.btn-form-cancel:hover { background: #7c8697; }

/* ---------------------------------------------------------------------
   Calendar (month grid view)
   --------------------------------------------------------------------- */
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.calendar-toolbar .cal-nav { display: flex; align-items: center; gap: 8px; }
.calendar-toolbar .cal-nav button { padding: 6px 10px; }
.calendar-toolbar .cal-title { font-size: 17px; font-weight: 600; }
.calendar-toolbar .cal-views { display: flex; gap: 6px; }
.calendar-toolbar .cal-views a {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12.5px; font-weight: 600; color: var(--text); text-decoration: none;
}
.calendar-toolbar .cal-views a.active { background: var(--bg); border-color: var(--text-faint); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.calendar-grid .cal-weekday {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border-soft);
}
.calendar-grid .cal-weekday:last-child { border-right: none; }
.calendar-grid .cal-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}
.calendar-grid .cal-day:nth-child(7n) { border-right: none; }
.calendar-grid .cal-day.out-month { background: var(--bg); }
.calendar-grid .cal-day.out-month .cal-day-num { color: var(--text-faint); }
.calendar-grid .cal-day-num { font-size: 13px; font-weight: 500; margin-bottom: 6px; display: inline-block; }
.calendar-grid .cal-day-num.today {
    background: var(--blue); color: #fff; width: 24px; height: 24px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.calendar-grid .cal-day.has-items { cursor: pointer; }
.calendar-grid .cal-day.has-items:hover { background: var(--bg); }

.cal-chip {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.cal-chip-event { background: var(--info-bg); color: var(--blue); }
.cal-chip-birthday { background: var(--warning-bg); color: var(--gold-dark); }
.cal-chip-anniversary { background: #F1E9FE; color: #7C3AED; }
.cal-chip-more { color: var(--text-faint); font-size: 10.5px; }

.cal-day-dots { display: none; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cal-dot-event { background: var(--blue); }
.cal-dot-birthday { background: var(--gold); }
.cal-dot-anniversary { background: #7C3AED; }

.cal-legend { display: flex; gap: 16px; margin-bottom: 14px; font-size: 12.5px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------------------------------------------------------------------
   Section sub-navigation tabs (e.g. within Members: Listing / Add /
   Families)
   --------------------------------------------------------------------- */
.subtab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.subtab-bar a {
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.subtab-bar a:hover { color: var(--blue); text-decoration: none; }
.subtab-bar a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ---------------------------------------------------------------------
   Profile header (Member / Family detail pages)
   --------------------------------------------------------------------- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.profile-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 22px; flex-shrink: 0;
}
.profile-header h1 { font-size: 21px; margin-bottom: 2px; }
.profile-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px 24px;
}
.profile-meta-grid dt { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 3px; }
.profile-meta-grid dd { font-size: 14px; color: var(--text); margin: 0 0 12px 0; }
.profile-meta-grid dd.empty { color: var(--text-faint); }
.family-role-badge { background: var(--info-bg); color: var(--blue); }

/* ---------------------------------------------------------------------
   Dashboard list panels (Recent Members, Birthdays, Upcoming Events...)
   --------------------------------------------------------------------- */
.list-panel { list-style: none; margin: 0; padding: 0; }
.list-panel li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
}
.list-panel li:last-child { border-bottom: none; }
.list-panel .li-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.list-panel .li-main { flex: 1; min-width: 0; }
.list-panel .li-title { font-weight: 500; color: var(--text); }
.list-panel .li-sub { font-size: 11.5px; color: var(--text-muted); }
.list-panel .li-meta { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.empty-note { color: var(--text-faint); font-size: 13px; padding: 8px 0; }
.chart-empty-state {
    height: 210px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-faint);
}
.chart-empty-state svg { width: 34px; height: 34px; margin-bottom: 10px; opacity: 0.6; }
.chart-empty-state p { margin: 0; font-size: 13px; }

/* ---------------------------------------------------------------------
   Dashboard v2 — greeting header, icon stat cards, event date-boxes,
   quick actions
   --------------------------------------------------------------------- */
.dash-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.dash-header h1 { font-size: 22px; margin-bottom: 4px; }
.dash-header p { color: var(--text-muted); font-size: 13px; margin: 0; }
.dash-date-badge {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 14px; font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap;
}

.stat-card-v2 { position: relative; overflow: hidden; }
.stat-card-v2 .stat-icon {
    position: absolute; top: 14px; right: 14px;
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--info-bg); color: var(--blue);
    display: flex; align-items: center; justify-content: center;
}
.stat-card-v2 .stat-icon svg { width: 16px; height: 16px; }
.stat-card-v2.icon-cyan .stat-icon { background: #E3F7FD; color: #1590B8; }
.stat-card-v2.icon-success .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-card-v2.icon-gold .stat-icon { background: var(--warning-bg); color: var(--gold-dark); }
.stat-card-v2.icon-purple .stat-icon { background: #F1E9FE; color: #7C3AED; }
.stat-card-v2 .stat-delta { font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.stat-card-v2 .stat-delta.positive { color: var(--success); }
.stat-card-v2 .stat-delta.neutral { color: var(--text-faint); }

.panel-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
    min-height: 44px;
}
.panel-header h2 { font-size: 14.5px; margin-bottom: 2px; }
.panel-header .panel-sub { font-size: 11.5px; color: var(--text-muted); }
.panel-header .panel-action { font-size: 12.5px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.panel-header .panel-action:hover { text-decoration: underline; }

.event-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.event-row:last-child { border-bottom: none; }
.event-datebox {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    background: var(--info-bg); color: var(--blue);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0; line-height: 1.1;
}
.event-datebox .ed-day { font-size: 14px; font-weight: 700; }
.event-datebox .ed-month { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.event-row .event-main { flex: 1; min-width: 0; }
.event-row .event-title { font-weight: 600; font-size: 13px; color: var(--text); }
.event-row .event-sub { font-size: 11.5px; color: var(--text-muted); }
.event-pill { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.event-pill.going { background: var(--success-bg); color: var(--success); }
.event-pill.open { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

.quick-action-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text);
    margin-bottom: 4px; transition: background var(--transition);
}
.quick-action-row:hover { background: var(--bg); text-decoration: none; }
.quick-action-row .qa-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--info-bg); color: var(--blue);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.quick-action-row .qa-icon svg { width: 17px; height: 17px; }
.quick-action-row .qa-title { font-weight: 600; font-size: 13px; }
.quick-action-row .qa-sub { font-size: 11.5px; color: var(--text-muted); }

.panel-icon {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--info-bg); color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.panel-icon svg { width: 16px; height: 16px; }
.panel-icon.icon-success { background: var(--success-bg); color: var(--success); }
.panel-header-icon { display: flex; align-items: flex-start; gap: 12px; }

.giving-amount { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.giving-progress-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-top: 12px; margin-bottom: 4px; }

.dash-bottom-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}
@media (max-width: 900px) { .dash-bottom-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------
   Simple modal (JS-toggled show/hide)
   --------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(22, 36, 74, 0.45);
    z-index: 100;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.modal-box .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
}
.modal-box .modal-header h3 { font-size: 15px; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text); }
.modal-box .modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 20px; line-height: 1; padding: 0; }
.modal-box .modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-box .modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 8px; }
.modal-member-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.modal-member-row:last-child { border-bottom: none; }
.modal-member-row input { width: auto; margin: 0; }

/* ---------------------------------------------------------------------
   Event details hero header
   --------------------------------------------------------------------- */
.event-hero {
    display: flex;
    gap: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px 26px;
    margin-bottom: 20px;
}
.event-hero-date {
    flex-shrink: 0;
    width: 84px; height: 84px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--blue) 0%, var(--navy-2) 100%);
    color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1.1;
}
.event-hero-date .ehd-month { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.event-hero-date .ehd-day { font-size: 30px; font-weight: 700; }
.event-hero-date .ehd-year { font-size: 11px; opacity: 0.85; }
.event-hero-main { flex: 1; min-width: 0; }
.event-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}
.ehm-item {
    display: flex; align-items: center; gap: 7px;
    font-size: 13.5px; color: var(--text);
}
.ehm-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

/* ---------------------------------------------------------------------
   Communication dashboard — hero banner, delivery performance panel
   --------------------------------------------------------------------- */
.comm-hero {
    background: linear-gradient(120deg, var(--blue) 0%, var(--navy-2) 100%);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.comm-hero h1 { color: #fff; font-size: 21px; margin-bottom: 6px; }
.comm-hero p { color: rgba(255,255,255,0.82); font-size: 13.5px; margin: 0; }
.comm-hero-actions { display: flex; gap: 10px; flex-shrink: 0; }
.comm-hero-actions .btn-hero-secondary {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.comm-hero-actions .btn-hero-secondary:hover { background: rgba(255,255,255,0.22); }

.delivery-donut-row { display: flex; align-items: center; gap: 20px; }
.delivery-donut-wrap { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.delivery-donut-label {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.delivery-donut-label .ddl-pct { font-size: 20px; font-weight: 700; color: var(--text); }
.delivery-donut-label .ddl-sub { font-size: 10.5px; color: var(--text-muted); }
.delivery-stats-list { flex: 1; }
.delivery-stats-list .dsl-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.delivery-stats-list .dsl-row:last-child { border-bottom: none; }
.delivery-stats-list .dsl-value { font-weight: 600; color: var(--text); }

/* ---------------------------------------------------------------------
   Verse of the Day — scrolling marquee banner
   --------------------------------------------------------------------- */
.verse-banner {
    background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 100%);
    border-radius: var(--radius-lg);
    padding: 13px 0;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
}
.verse-banner::before, .verse-banner::after {
    content: '';
    position: absolute; top: 0; bottom: 0; width: 40px; z-index: 2;
}
.verse-banner::before { left: 0; background: linear-gradient(90deg, var(--navy) 0%, transparent 100%); }
.verse-banner::after { right: 0; background: linear-gradient(270deg, var(--blue) 0%, transparent 100%); }
.verse-track {
    display: flex;
    width: max-content;
    animation: verse-scroll 38s linear infinite;
}
.verse-banner:hover .verse-track { animation-play-state: paused; }
.verse-item {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    padding: 0 40px;
}
.verse-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.verse-item .verse-label { font-weight: 700; opacity: 0.9; }
.verse-item .verse-ref { opacity: 0.8; font-style: italic; }
@keyframes verse-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.upcoming-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) { .upcoming-grid { grid-template-columns: 1fr; } }

.mini-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
.mini-pagination button,
.mini-pagination a:not(.btn-secondary) {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 12px; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.mini-pagination button:hover:not(.active),
.mini-pagination a:not(.btn-secondary):hover:not(.active) { background: var(--bg); }
.mini-pagination button.active,
.mini-pagination a.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.dash-bottom-grid .card {
    box-shadow: 0 4px 14px rgba(22, 36, 74, 0.08), 0 1px 3px rgba(22, 36, 74, 0.05);
    border-radius: 14px;
    margin-top: 0;
}

/* ---------------------------------------------------------------------
   Toggle switch (staff permission grants)
   --------------------------------------------------------------------- */
.permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
}
.permission-row:last-child { border-bottom: none; }
.permission-row .permission-label { font-weight: 600; font-size: 14px; color: var(--text); }
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .toggle-track {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border); border-radius: 999px;
    transition: background var(--transition);
}
.toggle-switch .toggle-track::before {
    content: ''; position: absolute;
    height: 18px; width: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-track { background: var(--blue); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); }
.toggle-switch input:disabled + .toggle-track { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   Reports catalog
   --------------------------------------------------------------------- */
.report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
}
.report-row:last-child { border-bottom: none; }
.report-row .report-title { font-weight: 600; font-size: 14.5px; color: var(--text); margin-bottom: 2px; }
.report-row .report-desc { font-size: 12.5px; color: var(--blue); }
.btn-outline {
    background: transparent;
    color: var(--blue);
    border: 1px solid var(--blue);
}
.btn-outline:hover { background: var(--info-bg); }

/* ---------------------------------------------------------------------
   Members Photo Directory
   --------------------------------------------------------------------- */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.directory-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.directory-photo-link { display: block; text-decoration: none; }
.directory-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    background: var(--bg);
    object-fit: cover;
    margin-bottom: 12px;
    display: block;
}
.directory-photo-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border-soft);
    margin-bottom: 12px;
}
.directory-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}
.directory-name:hover { text-decoration: underline; }
.directory-status { font-size: 12px; color: var(--blue); margin-bottom: 12px; }
.directory-actions { display: flex; justify-content: center; gap: 8px; }
.directory-icon {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
    color: var(--text-faint);
    text-decoration: none;
    flex-shrink: 0;
}
.directory-icon svg { width: 15px; height: 15px; }
.directory-icon.active-phone { background: var(--success-bg); color: var(--success); }
.directory-icon.active-text { background: #E4E9F5; color: var(--navy-2); }
.directory-icon.active-email { background: var(--info-bg); color: var(--blue); }
.directory-icon.active-phone:hover, .directory-icon.active-text:hover, .directory-icon.active-email:hover { opacity: 0.8; }

/* ---------------------------------------------------------------------
   Members list card (header / search+filter row / footer)
   --------------------------------------------------------------------- */
.member-list-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap; gap: 12px;
}
.member-list-header h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 10px; }
.count-badge {
    background: var(--bg); color: var(--text-muted);
    font-size: 12.5px; font-weight: 600;
    padding: 2px 10px; border-radius: 999px;
}
.member-search-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
}
.member-search-wrap { position: relative; flex: 1; min-width: 220px; }
.member-search-wrap button {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; padding: 0;
    background: var(--blue); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; border-radius: 50%;
}
.member-search-wrap button:hover { background: var(--blue-light); }
.member-search-wrap button svg { width: 14px; height: 14px; }
.member-search-wrap input { padding-right: 40px; margin: 0; }
.segmented-control {
    display: flex; gap: 2px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 3px;
}
.segmented-control a {
    padding: 6px 14px; font-size: 12.5px; font-weight: 600;
    color: var(--text-muted); text-decoration: none; border-radius: 6px;
}
.segmented-control a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.member-list-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; flex-wrap: wrap; gap: 10px;
}

.table-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0;
}

.sort-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: inherit; text-decoration: none; cursor: pointer;
}
.sort-link:hover { color: var(--text); }
.sort-link .sort-icon { width: 11px; height: 11px; flex-shrink: 0; opacity: 0.45; }
.sort-link.active .sort-icon { opacity: 1; color: var(--blue); }

.danger-zone {
    border: 1px solid var(--danger-bg);
    background: var(--danger-bg);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-top: 24px;
}
.danger-zone h3 { color: var(--danger); font-size: 13.5px; margin: 0 0 6px 0; text-transform: none; letter-spacing: 0; }
.danger-zone p { font-size: 12.5px; color: var(--text-muted); margin: 0 0 12px 0; }

.profile-hero-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.profile-hero-photo, .profile-hero-avatar {
    width: 200px; height: 200px; border-radius: 50%;
    border: 4px solid #fff; box-shadow: 0 4px 14px rgba(22,36,74,0.12);
    object-fit: cover; flex-shrink: 0;
}
.profile-hero-avatar {
    display: flex; align-items: center; justify-content: center;
    background: var(--navy); color: #fff; font-weight: 700; font-size: 54px;
}
.profile-hero-name { font-size: 26px; font-weight: 800; color: var(--navy); margin: 0 0 10px 0; }
.profile-hero-row { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text); margin-bottom: 8px; }
.hero-icon { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.profile-hero-dot { color: var(--text-faint); margin: 0 2px; }
.profile-hero-divider { border: none; border-top: 1px solid var(--border-soft); margin: 14px 0; }
.profile-hero-dob-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.profile-hero-dob-value { font-size: 14.5px; font-weight: 400; color: var(--text); }

/* =======================================================================
   MOBILE RESPONSIVENESS — PHASE 1: Foundation
   Shell (sidebar/topbar) + shared components used across every page.
   Breakpoints: 768px (tablet/phone), 480px (small phone).
   ======================================================================= */

.hamburger-btn {
    display: none;
    background: none; border: none; padding: 6px; margin-right: 6px;
    color: var(--text); cursor: pointer; flex-shrink: 0;
}
.hamburger-btn svg { width: 22px; height: 22px; }
.sidebar-close-btn {
    display: none;
    background: none; border: none; padding: 4px; margin-left: auto;
    color: var(--text-on-dark-muted); cursor: pointer; flex-shrink: 0;
}
.sidebar-close-btn svg { width: 18px; height: 18px; }
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 20, 35, 0.55);
    z-index: 999;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
    .hamburger-btn { display: flex; align-items: center; justify-content: center; }
    .sidebar-close-btn { display: flex; align-items: center; justify-content: center; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1000;
        width: min(280px, 84vw);
    }
    .sidebar.open { transform: translateX(0); }

    .main-area { margin-left: 0; }

    .topbar { padding: 0 14px; gap: 8px; }
    .topbar h1 { font-size: 16px; }
    .page-content { padding: 16px 14px 32px; }

    .dash-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .dash-header h1 { font-size: 19px; }

    /* Stat/chart/dashboard grids: collapse to a single column so every
       card stays full-width and readable instead of squeezed.
       !important here is deliberate: these must always win at mobile
       widths no matter where a component's own base grid rule ends up
       in the file — two equal-specificity rules would otherwise be
       decided by source order, which is fragile as more get added. */
    .stat-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
    .chart-grid { grid-template-columns: 1fr !important; }
    .dash-bottom-grid { grid-template-columns: 1fr !important; }
    .upcoming-grid { grid-template-columns: 1fr !important; }
    .directory-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important; gap: 12px; }
    .profile-top-grid { grid-template-columns: 1fr !important; }
    .deposit-top-row { grid-template-columns: 1fr !important; }
    .comm-summary-grid { grid-template-columns: 1fr !important; }

    /* Forms: every field-grid becomes a single column; a field that
       spanned 2 columns on desktop just becomes full-width here. */
    .field-grid { grid-template-columns: 1fr; }
    .field-grid .field-wide { grid-column: span 1; }
    .form-actions { flex-wrap: wrap; }

    /* Filter/search rows and segmented controls wrap naturally, but
       give them a bit more breathing room stacked than side-by-side. */
    .member-search-row, .report-row, .flex-between { flex-wrap: wrap; gap: 10px; }
    .segmented-control { width: 100%; justify-content: space-between; }

    /* Modals: near-full-width instead of a fixed narrow box, and cap
       height so the footer buttons are always reachable. */
    .modal-box { width: 92vw; max-width: 92vw; max-height: 88vh; }

    /* Tables: safe universal fallback is horizontal scroll. Specific
       simpler tables get converted to a stacked card view module by
       module in later phases — this keeps every table usable today
       without waiting for that per-table work. */
    .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-card table { min-width: 640px; }

    /* Profile hero card (member profile): stack photo above text
       instead of side-by-side, which gets cramped under ~400px. */
    .profile-hero-card { flex-direction: column; text-align: center; }
    .profile-hero-card .profile-hero-row { justify-content: center; }
    .profile-hero-card .profile-hero-dob-label { justify-content: center; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .directory-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
    .page-content { padding: 12px 10px 28px; }
    .dash-header h1 { font-size: 17px; }
}

/* =======================================================================
   MOBILE RESPONSIVENESS — PHASE 2: Members module
   Reusable table→card mechanism for "simple" tables (a name/thing plus
   a few facts). Opt-in via .mobile-cards on the .table-card wrapper —
   dense tables (Finance, Reports) keep Phase 1's horizontal-scroll
   fallback instead. Each <td> needs a data-label attribute matching
   its column header for this to work; the first column (name) and
   last column (actions) get special treatment — no label prefix,
   styled as a card title and a right-aligned action row.
   ======================================================================= */
@media (max-width: 768px) {
    .table-card.mobile-cards { overflow-x: visible; }
    .table-card.mobile-cards table { min-width: 0; width: 100%; }
    .table-card.mobile-cards thead { display: none; }
    .table-card.mobile-cards tr:first-child { display: none; }
    .table-card.mobile-cards tbody, .table-card.mobile-cards tr { display: block; width: 100%; }
    .table-card.mobile-cards tr {
        border-bottom: 1px solid var(--border-soft);
        padding: 12px 16px;
    }
    .table-card.mobile-cards tr:last-child { border-bottom: none; }
    .table-card.mobile-cards td {
        display: flex; justify-content: space-between; align-items: center;
        gap: 10px; padding: 4px 0; border: none; white-space: normal;
    }
    .table-card.mobile-cards td::before {
        content: attr(data-label);
        font-size: 11px; font-weight: 600; color: var(--text-muted);
        text-transform: uppercase; letter-spacing: 0.03em; flex-shrink: 0;
    }
    .table-card.mobile-cards td:first-child {
        display: block; font-weight: 600; font-size: 14.5px; color: var(--text);
        padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border-soft);
    }
    .table-card.mobile-cards td:first-child::before { content: none; }
    .table-card.mobile-cards td:last-child { justify-content: flex-end; }
    .table-card.mobile-cards td:last-child::before { content: none; }
    .table-card.mobile-cards td[colspan] { display: block; text-align: center; padding: 16px 0; }

    /* Member edit form: Photo card + Save/Cancel buttons stack instead
       of squeezing side-by-side with space-between on a narrow screen. */
    .member-photo-actions-row { flex-direction: column; }
    .member-photo-actions-row > div:last-child { width: 100%; }
    .member-photo-actions-row > div:last-child button,
    .member-photo-actions-row > div:last-child a { flex: 1; }

    /* Family Map legend: wrap instead of overflowing off the map. */
    .cal-legend { flex-wrap: wrap; }

    /* Calendar toolbar (nav / title / view tabs): wrap instead of
       squeezing three groups onto one row on a narrow screen. */
    .calendar-toolbar { flex-wrap: wrap; gap: 10px; justify-content: center; text-align: center; }

    /* Calendar month grid: stays a real 7-column grid at phone width
       (no horizontal scroll) — cells just show the day number and a
       small colored dot per item type instead of full event names,
       which is what let it fit without squeezing text unreadably.
       Tapping a day with items opens a small popup with the details. */
    .cal-day { min-height: 56px; padding: 6px 4px; }
    .cal-day .cal-chips-desktop { display: none; }
    .cal-day-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; justify-content: center; }
    .cal-weekday { padding: 6px 2px; font-size: 9.5px; text-align: center; }
    .cal-day-num { display: block; text-align: center; }
}

.profile-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.comm-summary-grid { grid-template-columns: 1.4fr 1fr; }

/* ---------------------------------------------------------------------
   Finance Deposits
   --------------------------------------------------------------------- */
.deposit-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    align-items: stretch;
}
.deposit-hero-card {
    background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 100%);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(22, 36, 74, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.deposit-hero-amount { font-size: 34px; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.deposit-hero-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.deposit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.deposit-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.deposit-summary-amount { font-size: 19px; font-weight: 700; color: var(--text); }
.deposit-summary-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Utility */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* SMS / Communication channel toggle (Compose page)
   NOTE: --blue-light is a medium blue (button hover shade), not a pale
   tint — using it as a background behind var(--blue) text produced
   blue-on-blue, effectively invisible text. Use a real pale tint
   instead for the active/hover chip backgrounds. */
.channel-toggle { display: flex; gap: 8px; }
.channel-toggle-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    background: #fff; color: var(--text-muted); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.channel-toggle-btn.active { border-color: var(--blue); color: var(--blue); background: #E9EEFB; }
.channel-toggle-btn:hover { background: #F3F6FB; color: var(--text); }
.channel-toggle-btn.active:hover { background: #DCE6FA; color: var(--blue); }

/* SMS delivery status badges (History page) */
.sms-status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.sms-status-delivered { background: #E3F6EA; color: #1E8A4C; }
.sms-status-sent { background: #E9EEFB; color: #3861B1; }
.sms-status-queued { background: #F1F3F7; color: #6B7280; }
.sms-status-failed, .sms-status-undelivered { background: #FBEAEA; color: #C0392B; }

.comm-channel-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.comm-channel-tab {
    padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
    color: var(--text-muted); text-decoration: none; border: 1px solid transparent;
}
.comm-channel-tab.active { background: #E9EEFB; color: var(--blue); border-color: var(--blue); }
.comm-channel-tab:hover:not(.active) { background: var(--bg); }


/* Manage-user popup: uniform action rows (icon + title + hint) */
.manage-actions { display: flex; flex-direction: column; gap: 4px; }
.manage-actions form { margin: 0; }
.manage-action {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 12px; margin: 0; text-align: left; text-decoration: none;
    background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
    color: var(--text); cursor: pointer; font: inherit; box-sizing: border-box;
}
.manage-action:hover { background: #F3F6FB; }
.manage-action svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-muted); }
.manage-action span { display: flex; flex-direction: column; gap: 2px; }
.manage-action strong { font-size: 13.5px; font-weight: 600; }
.manage-action small { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.manage-divider { height: 1px; background: var(--border-soft); margin: 6px 0; }
.manage-action-danger strong, .manage-action-danger svg { color: var(--danger); }
.manage-action-danger:hover { background: var(--danger-bg); }
