:root {
    --primary: #1D4ED8;
    --primary-light: #DBEAFE;
    --primary-dark: #1E3A8A;
    --bg: #F2F2F7;
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --green-50: #F0FDF4;
    --green-600: #16A34A;
    --green-700: #15803D;
    --amber-50: #FFFBEB;
    --amber-600: #D97706;
    --amber-700: #B45309;
    --red-50: #FEF2F2;
    --red-600: #DC2626;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--white);
    padding-bottom: 64px;
}

/* Bottom nav - truly fixed */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    border-top: 1px solid var(--gray-100);
    padding: 6px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: var(--white);
    z-index: 50;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--gray-400);
    text-decoration: none;
    padding: 4px;
}
.nav-item.active { color: var(--primary); }

/* Top bar */
.top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-100);
}
.top-bar a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
}

/* Page padding */
.page-content {
    padding: 20px;
}

/* Stat cards */
.stat-row {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.stat-card {
    flex: 1;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
}
.stat-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}
.stat-lbl {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Badges */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.badge-green { background: var(--green-50); color: var(--green-700); }
.badge-amber { background: var(--amber-50); color: var(--amber-700); }
.badge-blue { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Info rows */
.info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}
.info-row:last-child { border-bottom: none; }
.info-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--gray-400);
    margin-top: 2px;
}
.info-text { font-size: 14px; color: var(--gray-800); }
.info-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--gray-200);
    margin-top: 10px;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}
.form-input, .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color 0.15s;
    -webkit-appearance: none;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}
.form-input::placeholder { color: var(--gray-400); }
.form-row {
    display: flex;
    gap: 10px;
}
.form-row .form-group { flex: 1; }

/* Toggle group */
.toggle-group {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 3px;
    gap: 3px;
}
.toggle-opt {
    flex: 1;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s;
    border: none;
    background: transparent;
}
.toggle-opt.active, .toggle-opt:checked,
input[type="radio"]:checked + .toggle-opt {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
}

/* Alert boxes */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin: 12px 0;
}
.alert-info { background: var(--primary-light); color: var(--primary-dark); }
.alert-warning { background: var(--amber-50); color: var(--amber-700); }
.alert-error { background: var(--red-50); color: var(--red-600); }
.alert-success { background: var(--green-50); color: var(--green-700); }

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px 0;
}
.step-dot {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: var(--gray-200);
}
.step-dot.done { background: var(--primary); }

/* Church hero */
.church-hero {
    width: 100%;
    height: 160px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.church-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Search */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}
.search-box input {
    border: none;
    outline: none;
    font-size: 15px;
    flex: 1;
    background: transparent;
    color: var(--gray-900);
}
.search-box input::placeholder { color: var(--gray-400); }

/* Church list */
.church-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.church-list-item:last-child { border-bottom: none; }
.church-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: var(--gray-100);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.church-thumb img { width: 100%; height: 100%; object-fit: cover; }
.church-name { font-size: 15px; font-weight: 600; }
.church-meta { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* Family cards */
.family-card {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.family-card:hover { background: var(--gray-50); }
.family-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.family-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    flex-shrink: 0;
}
.family-card.selected .family-avatar {
    background: var(--primary);
    color: #fff;
}
.family-name { font-size: 14px; font-weight: 600; }
.family-count { font-size: 12px; color: var(--gray-500); }

/* Success */
.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--green-50);
    margin: 32px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.success-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}
.success-sub {
    font-size: 14px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 24px;
}

/* Summary card */
.summary-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 20px;
}
.summary-card .label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.summary-row {
    font-size: 14px;
    padding: 4px 0;
    display: flex;
    gap: 8px;
}
.summary-row .key { color: var(--gray-500); }
.summary-row .val { color: var(--gray-800); font-weight: 500; }

/* Photo circle */
.photo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    cursor: pointer;
    overflow: hidden;
}
.photo-circle img { width: 100%; height: 100%; object-fit: cover; }

/* Photos grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin: 12px 0;
    border-radius: var(--radius);
    overflow: hidden;
}
.photos-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* QR */
.qr-container {
    text-align: center;
    padding: 20px 0;
}
.qr-container img {
    width: 200px;
    height: 200px;
    border-radius: var(--radius);
}

/* Map placeholder */
.map-placeholder {
    width: 100%;
    height: 120px;
    background: var(--gray-100);
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--gray-400);
    cursor: pointer;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}
.empty-state p { font-size: 14px; margin-top: 8px; }

/* Home dark hero */
.home-dark-hero {
    position: relative;
    height: 220px;
    background: linear-gradient(145deg, #0F172A, #1E3A5C);
    overflow: hidden;
}
.hdh-circle-1 {
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(59,130,246,0.1);
}
.hdh-circle-2 {
    position: absolute;
    bottom: -60px; left: -30px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(59,130,246,0.06);
}
.hdh-content {
    position: relative;
    padding: 48px 24px 0;
}
.hdh-name {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}
.hdh-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    line-height: 1.4;
}
.hdh-stats {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}
.hdh-stat-num {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}
.hdh-stat-lbl {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}
.hdh-actions {
    display: flex;
    gap: 10px;
    margin-top: -28px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    padding: 0 20px;
}
.hdh-action-card {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    background: var(--white);
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 0.5px solid var(--gray-200);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s;
}
.hdh-action-card:active { transform: scale(0.96); }
.hdh-action-lbl {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-800);
    margin-top: 4px;
}
.section-title {
    font-size: 16px;
    font-weight: 700;
    padding: 0 20px;
    margin-bottom: 8px;
}

/* Country page */
.pais-hero {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #1a3a5c, #2a5a4a 40%, #3a6a3a 70%, #5a7a4a);
    overflow: hidden;
}
.pais-hero > img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.5;
}
.pais-hero-grad {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 110px;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
}
.pais-hero-flag {
    position: absolute;
    top: 14px; right: 14px;
    width: 48px; height: 32px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
}
.pais-hero-flag img { width: 100%; height: 100%; object-fit: cover; }
.pais-hero-content {
    position: absolute;
    bottom: 16px; left: 20px; right: 80px;
    color: #fff;
}
.pais-hero-name { font-size: 22px; font-weight: 700; }
.pais-hero-sub { font-size: 12px; opacity: 0.75; margin-top: 2px; }

.stat-strip {
    display: flex;
    margin: 14px 0;
    gap: 1px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.stat-strip-item {
    flex: 1;
    padding: 12px 6px;
    text-align: center;
    background: var(--gray-50);
}
.stat-strip-num { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.stat-strip-lbl { font-size: 10px; color: var(--gray-500); margin-top: 2px; }

.org-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}
.org-row:hover { background: var(--gray-100); }
.org-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.org-num { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.org-lbl { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

.soc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.soc-card {
    position: relative;
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
    padding: 20px 16px;
    transition: transform 0.15s;
}
.soc-card:active { transform: scale(0.97); }
.soc-circle-1 {
    position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.soc-circle-2 {
    position: absolute;
    bottom: -30px; right: 10px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.soc-card-content {
    position: relative;
    z-index: 1;
}
.soc-num { font-size: 32px; font-weight: 700; color: #fff; line-height: 1; }
.soc-name { font-size: 14px; color: rgba(255,255,255,0.9); margin-top: 6px; font-weight: 500; }
.soc-action { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 12px; }
.soc-dim { color: rgba(255,255,255,0.35); }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 100;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-sheet {
    background: var(--white);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 20px;
    animation: slideUp 0.25s ease-out;
}
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.modal-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-200);
    margin: 0 auto 14px;
}
.modal-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}
.modal-member:last-child { border-bottom: none; }
.modal-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px; font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}
.modal-name { font-size: 14px; font-weight: 500; }
.modal-meta { font-size: 12px; color: var(--gray-500); }

/* Utilities */
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-500); }

/* Church hero with gradient overlay */
.church-hero {
    position: relative;
    height: 200px;
    background: var(--gray-800);
    overflow: hidden;
}
.church-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}
.hero-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(transparent, rgba(15,23,42,0.85));
}
.hero-back {
    position: absolute;
    top: 14px; left: 14px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.hero-content {
    position: absolute;
    bottom: 16px; left: 20px; right: 20px;
    color: #fff;
}
.hero-name { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.hero-loc { font-size: 13px; opacity: 0.8; }
.badge-green-hero { background: rgba(22,163,74,0.9); color: #fff; margin-top: 6px; }
.badge-amber-hero { background: rgba(217,119,6,0.9); color: #fff; margin-top: 6px; }

/* Session pill */
.session-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--green-700);
    background: var(--green-50);
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

/* Lock message */
.lock-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--gray-500);
}
.lock-msg a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* Session banner on home */
.session-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
}
.session-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px; font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

/* Church card link (in profile) */
.church-card-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    margin-bottom: 4px;
}

/* Section title small */
.section-title-sm {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Member rows */
.member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.member-row:last-child { border-bottom: none; }
.member-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px; font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 14px; font-weight: 500; }
.member-meta { font-size: 12px; color: var(--gray-500); margin-top: 1px; }
.link-more {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

/* Stat card link variant */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: border-color 0.15s;
}
.stat-card-link:hover { border-color: var(--primary); }
.stat-action { font-size: 11px; color: var(--primary); margin-top: 2px; }

/* Next meeting */
.next-meeting {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.next-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}
.next-date { font-size: 12px; font-weight: 600; color: var(--primary-dark); }
.next-type { font-size: 14px; font-weight: 500; color: var(--primary-dark); }
.next-time { font-size: 12px; color: var(--primary); }

/* Schedule */
.schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}
.schedule-row:last-child { border-bottom: none; }
.schedule-day {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px; font-weight: 700;
    color: var(--gray-600);
    flex-shrink: 0;
    text-transform: uppercase;
}
.schedule-name { font-size: 14px; font-weight: 500; color: var(--gray-800); }
.schedule-time { font-size: 12px; color: var(--gray-500); }

/* Map */
.map-container {
    width: 100%;
    height: 140px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 4px;
}
.map-container img { width: 100%; height: 100%; object-fit: cover; }
.address-text {
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 4px;
}

/* QR row */
.qr-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.qr-box {
    width: 64px; height: 64px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

/* Tab row (pastor panel) */
.tab-row {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 12px;
}
.tab-item {
    flex: 1;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
    color: var(--gray-500);
    text-decoration: none;
    position: relative;
}
.tab-item.active {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
}
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--red-600);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

/* Transfer card */
.transfer-card {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 12px;
}
.transfer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.transfer-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.btn-approve {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--green-600);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn-reject {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius);
    background: transparent;
    color: var(--red-600);
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
}

/* iOS-style grouped list */
.ios-list {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--gray-200);
    overflow: hidden;
}
.ios-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
    position: relative;
}
.ios-list-item:active { background: var(--gray-50); }
.ios-list-item + .ios-list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 64px;
    right: 0;
    height: 0.5px;
    background: var(--gray-200);
}
.ios-list-item .ios-chevron {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--gray-300);
}

/* Country rows (use inside ios-list) */
.country-flag {
    width: 40px; height: 28px;
    border-radius: 4px;
    background: var(--gray-100);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
}
.country-flag img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.country-info { flex: 1; min-width: 0; }
.country-name { font-size: 15px; font-weight: 500; }
.country-meta { font-size: 12px; color: var(--gray-500); margin-top: 1px; }

/* Actions row */
.actions-row {
    display: flex;
    gap: 8px;
}
.actions-row .btn { flex: 1; }

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
    margin: 8px 0;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 0; bottom: 0;
    width: 2px;
    background: var(--gray-200);
    border-radius: 1px;
}
.tl-item {
    position: relative;
    padding: 8px 0 12px;
}
.tl-dot {
    position: absolute;
    left: -20px; top: 12px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 2px solid var(--primary);
}
.tl-dot-green { background: var(--green-50); border-color: var(--green-600); }
.tl-dot-amber { background: var(--amber-50); border-color: var(--amber-600); }
.tl-date { font-size: 11px; color: var(--gray-400); }
.tl-event { font-size: 14px; font-weight: 500; color: var(--gray-800); margin-top: 1px; }
.tl-detail { font-size: 12px; color: var(--gray-500); }

/* OpenStreetMap */
.osm-map {
    width: 100%;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 6px;
}

/* Family section */
.family-section {
    margin-bottom: 16px;
}
.family-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

/* QR modal */
.qr-enlarge {
    cursor: pointer;
    transition: transform 0.15s;
}
.qr-enlarge:active { transform: scale(0.97); }
.qr-modal-content {
    text-align: center;
    padding: 20px;
}
.qr-modal-content img {
    width: 240px;
    height: 240px;
    border-radius: 12px;
    margin: 12px 0;
}
.qr-modal-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}
.qr-modal-sub {
    font-size: 13px;
    color: var(--gray-500);
}
.qr-modal-url {
    font-size: 12px;
    color: var(--primary);
    word-break: break-all;
    margin-top: 8px;
}
.qr-modal-close {
    margin-top: 16px;
    padding: 12px;
    width: 100%;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
}

/* Country summary cards grid */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}
.summary-box {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.summary-box:hover { background: var(--gray-100); }
.summary-box-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}
.summary-box-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}
.summary-box-action {
    font-size: 11px;
    color: var(--primary);
    margin-top: 6px;
}

/* Two button row */
.two-btn-row {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.two-btn-row .btn { flex: 1; }

/* Himnario */
.himno-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.himno-row:last-child { border-bottom: none; }
.himno-num {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px; font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}
.himno-info { flex: 1; min-width: 0; }
.himno-titulo { font-size: 14px; font-weight: 500; }
.himno-autor { font-size: 12px; color: var(--gray-500); margin-top: 1px; }
.himno-snippet {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 3px;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.himno-letra {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-800);
    white-space: pre-wrap;
}

/* Mic button */
.mic-btn {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.mic-btn:hover { background: var(--gray-100); }
.mic-btn.mic-active {
    background: var(--red-50);
}
.mic-btn.mic-active svg { stroke: var(--red-600); }
.mic-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--gray-600);
}
.mic-pulse {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--red-600);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.3)} }

/* Notifications */
.notif-badge {
    position: absolute;
    top: -6px; right: -6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--red-600);
    color: #fff;
    font-size: 10px; font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.notif-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-titulo { font-size: 14px; font-weight: 500; }
.notif-msg { font-size: 13px; color: var(--gray-600); margin-top: 2px; }
.notif-time { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.notif-action {
    font-size: 13px; font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
    align-self: center;
}

/* Validation banner */
.validacion-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--amber-50);
    color: var(--amber-700);
    border-radius: var(--radius);
    margin-bottom: 12px;
    text-decoration: none;
    font-size: 13px;
}

/* Predicaciones */
.pred-card {
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}
.pred-card:last-child { border-bottom: none; }
.pred-date { font-size: 12px; color: var(--gray-400); }
.pred-titulo { font-size: 15px; font-weight: 500; margin-top: 2px; }
.pred-desc { font-size: 13px; color: var(--gray-600); margin-top: 4px; }
.pred-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px; font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    margin-top: 8px;
}

/* Resource links */
.resource-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
}
.resource-row:last-child { border-bottom: none; }
.resource-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
