/* ===== Base & Reset ===== */
:root {
    --primary: #0D7A3D;
    --primary-dark: #095C2E;
    --primary-light: #E8F5E9;
    --accent: #2E9E5F;
    --bg: #F3F6F4;
    --card: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E7EB;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --radius: 18px;
    --radius-lg: 24px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #E8EDEA;
    color: var(--text);
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

input, select {
    font-family: inherit;
    outline: none;
}

/* ===== Mobile Frame ===== */
.mobile-frame {
    width: 100%;
    max-width: 414px;
    height: 100vh;
    max-height: 896px;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
}

@media (min-width: 450px) {
    .mobile-frame {
        height: 90vh;
        margin-top: 5vh;
        border-radius: 40px;
        border: 8px solid #1A1A1A;
    }
}

.status-bar {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    flex-shrink: 0;
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.app-container::-webkit-scrollbar {
    display: none;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    height: 80px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s;
    min-width: 56px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-add {
    position: relative;
    top: -18px;
}

.nav-add-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(13, 122, 61, 0.35);
}

/* ===== Buttons ===== */
.btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-light {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== Cards ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

/* ===== Avatars ===== */
.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 18px;
    position: relative;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 28px;
}

.avatar-sm {
    width: 44px;
    height: 44px;
    font-size: 14px;
}

.avatar-xs {
    width: 36px;
    height: 36px;
    font-size: 12px;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.verified-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.verified-badge svg {
    width: 9px;
    height: 9px;
}

/* ===== Form Elements ===== */
.input-group {
    margin-bottom: 18px;
}

.input-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--primary);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .input-field {
    padding-left: 48px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.select-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-green {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-primary {
    background: var(--primary);
    color: #fff;
}

.badge-outline {
    background: transparent;
    border: 1.5px solid currentColor;
}

/* ===== Header Components ===== */
.page-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* ===== Splash / Login Screen ===== */
.splash-screen {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 28px;
    text-align: center;
    background: #fff;
}

.splash-logo {
    margin-top: 40px;
    margin-bottom: 24px;
}

.logo-tree {
    width: 140px;
    height: 140px;
    margin: 0 auto 16px;
    position: relative;
}

.logo-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
}

.logo-title span {
    display: block;
    font-size: 38px;
    font-weight: 700;
    color: var(--text);
}

.tagline {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.subtagline {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 280px;
    margin-bottom: 40px;
}

.phone-input-group {
    width: 100%;
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #fff;
}

.country-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border-right: 1.5px solid var(--border);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: #FAFAFA;
}

.phone-input {
    flex: 1;
    border: none;
    padding: 16px;
    font-size: 16px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 30px;
    font-size: 12px;
    color: var(--text-muted);
}

.leaf-decoration {
    position: absolute;
    left: -20px;
    bottom: 120px;
    opacity: 0.15;
    pointer-events: none;
}

/* ===== Home Screen ===== */
.home-screen {
    padding: 0 20px 20px;
}

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 20px;
}

.home-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-header-info h1 {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.home-header-info .name {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wave {
    font-size: 20px;
}

.trust-score {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.trust-score span {
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
}

.verified-text {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.icon-btn.bell {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #EF4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.overview-card {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 24px;
}

.overview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.overview-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(255,255,255,0.1));
}

.stat-icon.check { color: #86EFAC; }
.stat-icon.clock { color: #FCD34D; }
.stat-icon.mail { color: #93C5FD; }
.stat-icon.users { color: #ffffff; }

.stat-label {
    font-size: 12px;
    opacity: 0.85;
}

.overview-btn {
    background: rgba(255,255,255,0.95);
    color: var(--primary);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.overview-btn-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
}

.section-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.activity-time {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}

/* ===== Tree Screen ===== */
.tree-screen {
    padding: 0 20px 20px;
}

.tree-tabs {
    display: flex;
    background: #fff;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.tree-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 12px;
}

.tree-tab {
    text-decoration: none;
}

.tree-tab.active {
    background: var(--primary);
    color: #fff;
}

.tree-tab-content {
    display: none;
}

.tree-tab-content.active {
    display: block;
}

.invited-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-items: center;
}

.invited-card {
    text-align: center;
    cursor: pointer;
}

.invited-card .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 10px;
    position: relative;
    overflow: hidden;
}

.invited-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tree-container {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    min-height: 420px;
    position: relative;
    overflow-x: auto;
}

.family-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
}

.tree-generation {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 22px;
    position: relative;
}

.tree-couple {
    display: flex;
    gap: 16px;
    position: relative;
}

.tree-couple::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

/* Parent generation row: parents are visually grouped with their siblings
   (aunts/uncles) using a horizontal sibling connector. */
.parent-generation {
    display: inline-flex;
    gap: 32px;
    padding-bottom: 22px;
}

.parent-generation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #D1D5DB;
}

.parent-generation::before {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

.parent-generation > .tree-person {
    position: relative;
}

.parent-generation > .tree-person::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

.tree-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tree-person .avatar {
    width: 64px;
    height: 64px;
}

.tree-person-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.tree-person-role {
    font-size: 11px;
    color: var(--text-muted);
}

.tree-children {
    display: flex;
    justify-content: center;
    gap: 24px;
    position: relative;
    padding-top: 22px;
}

.tree-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

.tree-children::after {
    content: '';
    position: absolute;
    top: 0;
    left: 16%;
    right: 16%;
    height: 2px;
    background: #D1D5DB;
}

.tree-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.tree-child::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

.tree-child.active .avatar {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 122, 61, 0.15);
}

.tree-children-next {
    margin-top: 22px;
}

.tree-person.pending .avatar,
.tree-child.pending .avatar {
    border: 2px dashed #F59E0B;
    background: #FFF8E1;
    opacity: 0.95;
}

.tree-person.verified .avatar,
.tree-child.verified .avatar {
    border: 2px solid var(--primary);
}

.other-relatives {
    position: relative;
    padding-top: 32px;
}

.other-relatives-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sibling generation: each sibling/person has their own children branch below */
.sibling-generation {
    display: flex;
    justify-content: center;
    gap: 24px;
    position: relative;
    padding-top: 22px;
}

.sibling-generation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

.sibling-generation::after {
    content: '';
    position: absolute;
    top: 0;
    left: 16%;
    right: 16%;
    height: 2px;
    background: #D1D5DB;
}

.sibling-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.sibling-branch::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

.branch-children {
    display: flex;
    justify-content: center;
    gap: 16px;
    position: relative;
    padding-top: 22px;
    margin-top: 22px;
}

.branch-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 22px;
    background: #D1D5DB;
}

.branch-children::after {
    content: '';
    position: absolute;
    top: 0;
    left: 16%;
    right: 16%;
    height: 2px;
    background: #D1D5DB;
}

.tree-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.tree-controls button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.zoom-level {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 44px;
    text-align: center;
}

/* ===== Add Member Screen ===== */
.add-screen {
    padding: 0 20px 20px;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
}

.step.active .step-number {
    background: var(--primary);
    color: #fff;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    margin-bottom: 22px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ===== Connection Screen ===== */
.connection-screen {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
}

.connection-header {
    background: linear-gradient(135deg, #0D7A3D 0%, #126B38 100%);
    margin: 0 -20px 24px;
    padding: 40px 20px 60px;
    position: relative;
    overflow: hidden;
}

.connection-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.connection-avatars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.connection-avatars .avatar {
    width: 90px;
    height: 90px;
    border: 3px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 28px;
}

.link-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.connection-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    text-align: center;
    box-shadow: var(--shadow);
}

.connection-card h2 {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.connection-card .relation {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 18px;
}

.connection-message {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 18px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 24px;
}

.connection-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.view-profile-link {
    display: block;
    margin-top: 20px;
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

/* ===== Profile Screen ===== */
.profile-screen {
    padding: 0 0 20px;
}

.profile-header {
    background: linear-gradient(135deg, #0D7A3D 0%, #095C2E 100%);
    color: #fff;
    padding: 20px 20px 40px;
    border-radius: 0 0 30px 30px;
    position: relative;
}

.profile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-header-content .avatar {
    width: 86px;
    height: 86px;
    border: 3px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 28px;
}

.profile-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 10px;
}

.profile-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-badges .badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.profile-menu {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    font-size: 15px;
    font-weight: 500;
}

.menu-item svg:first-child {
    color: var(--primary);
}

.menu-item.logout {
    color: #DC2626;
}

.menu-item.logout svg:first-child {
    color: #DC2626;
}

.menu-arrow {
    margin-left: auto;
    color: var(--text-light);
}

/* ===== Footer Marketing Section ===== */
.footer-section {
    padding: 40px 20px 0;
    background: #fff;
}

.footer-section h3 {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    gap: 12px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-text h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.feature-text p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.footer-bar {
    background: var(--primary);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
    margin: 0 -20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.footer-tagline {
    font-size: 13px;
    opacity: 0.9;
}

.footer-url {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
}

.alert-success {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.w-full { width: 100%; }

/* ===== Connection Approval Listing ===== */
.connection-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.connection-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 8px 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.connection-list .connection-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    margin-top: 0;
    position: static;
    text-align: left;
    box-shadow: var(--shadow);
}

.connection-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.connection-profile .avatar {
    width: 56px;
    height: 56px;
    font-size: 22px;
    flex-shrink: 0;
}

.connection-profile-info {
    flex: 1;
    min-width: 0;
}

.connection-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.connection-relation {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.connection-relation strong {
    color: var(--primary);
}

.connection-phone {
    font-size: 13px;
    color: var(--text-light);
}

.connection-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

/* ===== Edit Profile Screen ===== */
.edit-profile-screen {
    padding: 0 20px 24px;
}

.edit-profile-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 122, 61, 0.08);
}

.form-input:disabled {
    background: var(--bg);
    color: var(--text-muted);
    cursor: not-allowed;
}

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

.gender-options {
    display: flex;
    gap: 10px;
}

.gender-option {
    flex: 1;
    position: relative;
}

.gender-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gender-option span {
    display: block;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gender-option input:checked + span {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

/* ===== Avatar Upload ===== */
.avatar-upload {
    align-items: center;
    text-align: center;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 36px;
    font-weight: 600;
    border: 3px solid var(--primary-light);
}

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

.avatar-preview-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.avatar-upload .form-input {
    padding: 10px;
    font-size: 14px;
}

/* ===== Member Detail Modal ===== */
.member-card {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.member-card:active {
    transform: scale(0.96);
}

.member-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.member-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.member-modal {
    background: #fff;
    width: 100%;
    max-width: 414px;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 32px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.member-modal-overlay.active .member-modal {
    transform: translateY(0);
}

.member-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.member-modal-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 36px;
    font-weight: 600;
    overflow: hidden;
}

.member-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}

.member-modal-header p {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin: 0;
}

.member-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.member-modal-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.member-modal-footer .btn {
    width: 100%;
    justify-content: center;
}

.member-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.member-modal-label {
    font-size: 14px;
    color: var(--text-muted);
}

.member-modal-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

@media (min-width: 480px) {
    .member-modal-overlay {
        align-items: center;
    }

    .member-modal {
        border-radius: 24px;
        transform: translateY(20px) scale(0.96);
    }

    .member-modal-overlay.active .member-modal {
        transform: translateY(0) scale(1);
    }
}

/* ===== Connection request member detail ===== */
.connection-profile.member-card {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius);
    transition: background 0.15s ease;
}

.connection-profile.member-card:hover {
    background: var(--bg);
}

.connection-profile.member-card:active {
    transform: scale(0.99);
}

.context-member-name {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-style: dotted;
    display: inline-block;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 4px;
    cursor: pointer;
}

/* ===== Activity Screen ===== */
.activity-screen {
    padding: 0 20px 24px;
}

.activity-list-full {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.activity-list-full .activity-item {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 14px;
}
