.container.home-page {
    width: var(--site-content, min(1520px, calc(100% - 16px))) !important;
    max-width: 1520px !important;
    margin: 0 auto !important;
    padding: 20px 0 48px !important;
}
.home-page .section {
    padding: 28px 28px !important;
    margin-bottom: 24px !important;
    background: #fff !important;
    border: 1px solid #e4ebf5 !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 14px rgba(20, 35, 63, 0.07) !important;
}
.home-page .section-title {
    font-size: 1.4rem !important;
    margin: 0 0 12px !important;
    padding-bottom: 10px !important;
}
.home-page .section-lede,
.home-page .section > p,
.home-page .section-description {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    margin: 0 0 16px !important;
    color: #4a5870;
}
.home-page .section-empty {
    text-align: center;
    padding: 18px;
    color: #66758f;
}

/* ===== HERO: full viewport (sizing from pages.css) ===== */
.welcome-section {
    background-image:
        linear-gradient(180deg, rgba(10, 20, 40, 0.28), rgba(10, 20, 40, 0.62)),
        url('../totem.jpeg') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;
}
.welcome-hero-img { display: none !important; }

/* ===== HISTORY — compact, space-efficient ===== */
.home-history {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    font-size: 0.94rem;
    line-height: 1.55;
    color: #24314a;
}
.home-history h3 {
    font-size: 1rem;
    margin: 14px 0 6px;
    padding-bottom: 5px;
    color: #1E3C72;
    border-bottom: 2px solid #FFD700;
    font-weight: 800;
}
.home-history h3:first-child { margin-top: 0; }
.home-history p,
.home-history .history-intro {
    margin: 0 0 8px;
}
.home-history a { color: #2A5298; font-weight: 700; }

/* Two titles side-by-side */
.history-title-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 10px;
}
.history-title-card {
    background: #f6f9fe;
    border: 1px solid #dce6f5;
    border-left: 3px solid #FFD700;
    border-radius: 8px;
    padding: 8px 10px;
}
.history-title-card strong {
    display: block;
    color: #1E3C72;
    font-size: 0.82rem;
    margin-bottom: 4px;
    line-height: 1.25;
}
.history-title-card p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #4a5870;
}

.home-history ol {
    margin: 6px 0 10px !important;
    padding-left: 0 !important;
    list-style: none !important;
}
.home-history .history-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    list-style: none;
    padding: 0 !important;
    margin: 8px 0 10px !important;
}
.home-history .history-chips li {
    background: #eef3fb;
    border: 1px solid #d5e0f2;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.78rem;
    margin: 0 !important;
    color: #1E3C72;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
}

/* Lutalo lineage — compact 2-column grid */
.home-history .history-lineage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    counter-reset: lineage-n;
}
.home-history .history-lineage-grid li {
    counter-increment: lineage-n;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0 !important;
    padding: 6px 8px;
    background: #f8fafd;
    border: 1px solid #e8eef6;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.35;
}
.home-history .history-lineage-grid li::before {
    content: counter(lineage-n);
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1E3C72;
    color: #FFD700;
    font-weight: 800;
    font-size: 0.68rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

/* ===== EXECUTIVES: 6 / 3 / 2 ===== */
.exec-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px 14px;
    margin-top: 8px;
}
.exec-card {
    background: #fff;
    border: 1px solid #e6edf7;
    border-radius: 16px;
    padding: 16px 10px 14px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(30,60,114,0.07);
    min-width: 0;
}
.exec-avatar {
    width: 112px;
    height: 112px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FFD700;
    background: #eef2f8;
    box-shadow: 0 0 0 3px #1E3C72;
}
.exec-avatar img,
.exec-avatar .exec-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}
.exec-avatar .exec-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8aa0c4;
    font-size: 2rem;
}
.exec-card h3 {
    font-size: 0.84rem;
    line-height: 1.3;
    margin: 0 0 4px;
    color: #1E3C72;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.exec-card .exec-role {
    font-size: 0.78rem;
    font-weight: 800;
    color: #2A5298;
    margin: 0;
}
.exec-card .exec-branch,
.exec-card .exec-phone {
    font-size: 0.72rem;
    color: #5b6b86;
    margin: 5px 0 0;
    line-height: 1.3;
}
.exec-card .exec-phone {
    color: #1E3C72;
    text-decoration: none;
    display: block;
    font-weight: 700;
}

/* ===== MEDIA: videos 16:9, photos perfect squares ===== */
.home-page .media-section { gap: 16px !important; }
.home-page .video-row,
.home-page .photo-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
}
.home-page .media-item {
    min-width: 0;
    background: #fff !important;
    border: 1px solid #e4ebf5;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(20, 35, 63, 0.06);
}

/* YouTube — normal 16:9 embeds */
.home-page .video-row .media-content.video-content {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    padding-top: 0 !important;
    background: #000 !important;
    position: relative;
    overflow: hidden;
}
.home-page .video-row .media-content.video-content iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Photos — perfect squares, full image visible (not cropped) */
.home-page .photo-row .media-content.photo-content {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    background: #eef3fa !important;
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.home-page .photo-row .media-content.photo-content img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block;
    transition: transform 0.35s ease;
}
.home-page .photo-row .media-item:hover .media-content.photo-content img {
    transform: scale(1.03);
}

.home-page .media-caption { padding: 12px 14px !important; }
.home-page .media-caption h3 { font-size: 0.95rem !important; margin: 0 0 4px !important; color: #1E3C72 !important; }
.home-page .media-caption p { font-size: 0.82rem !important; line-height: 1.45 !important; color: #5b6b86 !important; margin: 0 !important; }

/* ===== FAMILY TREE (absolute layout + jsPlumb connectors) ===== */
.home-page .section.home-tree-section {
    overflow: visible;
    transform: none !important;
    transition: none !important;
}

.home-page #family-tree-container {
    width: 100%;
    min-height: 70vh;
    height: auto;
    position: relative;
    background: linear-gradient(to bottom, #f9fbfd, #eef2f7);
    border-radius: 12px;
    margin: 12px 0 0;
    overflow: auto;
    padding: 24px 16px 40px;
    border: 1px solid #d1dbe5;
    box-sizing: border-box;
}

.home-page .person-node {
    position: absolute !important;
    width: 120px !important;
    min-height: 50px !important;
    padding: 12px 8px !important;
    background: linear-gradient(135deg, #ffffff, #f8faff) !important;
    color: #2c3e50 !important;
    border-radius: 8px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
    text-align: center !important;
    z-index: 10 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    border: 1px solid #d6e0f5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(42, 82, 152, 0.18);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease !important;
}

.home-page .person-node:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.2) !important;
    border-color: #4a6ea9 !important;
    background: linear-gradient(135deg, #f0f5ff, #e0ebff) !important;
    z-index: 100 !important;
}

.home-page .person-node.highlight-ancestor {
    background: linear-gradient(135deg, #e8f0fe, #d0e0fc) !important;
    border-color: #3a5e99 !important;
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.25) !important;
    z-index: 50 !important;
}

.home-page .person-node.highlight-main {
    background: linear-gradient(135deg, #d6e3ff, #b8d0ff) !important;
    border-color: #2a5298 !important;
    box-shadow: 0 5px 18px rgba(42, 82, 152, 0.3) !important;
    transform: scale(1.1) !important;
    z-index: 75 !important;
}

.home-page .person-node.is-root {
    border-color: #1E3C72 !important;
    background: linear-gradient(135deg, #fff8d6, #fff) !important;
    box-shadow: 0 0 0 2px #FFD700, 0 3px 10px rgba(0, 0, 0, 0.08) !important;
}

.home-page .person-name {
    font-weight: 600 !important;
    color: #2A5298 !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
    font-size: 12px !important;
}

.home-page .jtk-connector {
    z-index: 5;
}

.home-page .jtk-endpoint {
    z-index: 6;
}

.home-page .section {
    transition: none;
}

.home-page .section-title {
    position: relative;
    display: inline-block;
}

.home-page .section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 48px;
    height: 3px;
    background: var(--clan-gold, #FFD700);
    border-radius: 2px;
    transition: width 0.35s ease;
}

.home-page .section:hover .section-title::after {
    width: 72px;
}

.home-page .exec-card,
.home-page .media-item,
.home-page .recent-post-card {
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}

.home-page .exec-card:hover,
.home-page .media-item:hover,
.home-page .recent-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(30, 60, 114, 0.14);
}

.home-page .branch-row {
    transition: background 0.22s ease, transform 0.22s ease;
}

.home-page .branch-row:hover {
    transform: translateX(3px);
}

.home-page .btn-view-branch {
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.home-page .btn-view-branch:hover {
    transform: scale(1.12);
}

.home-page .family-tab {
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}

.home-page .family-tab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(30, 60, 114, 0.12);
}

#personDetailsModal,
#familyModal {
    z-index: 2100 !important;
}

#personDetailsModal .site-modal-card,
#familyModal .site-modal-card {
    max-width: 720px !important;
}

@media (max-width: 900px) {
    #personDetailsModal,
    #familyModal {
        padding: 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
        -webkit-overflow-scrolling: touch;
    }

    #personDetailsModal .site-modal-card,
    #familyModal .site-modal-card {
        max-width: 100% !important;
        width: 100%;
        margin: 3vh auto 2vh;
        max-height: min(92dvh, calc(100% - 16px));
        padding: 18px 14px 20px;
        border-radius: 14px;
        box-sizing: border-box;
    }

    #personDetailsModal .modal-title,
    #familyModal .modal-title {
        font-size: 1.05rem;
        margin-right: 44px;
    }

    .person-facts div {
        grid-template-columns: 1fr !important;
        gap: 4px;
    }
}

@media (max-width: 640px) {
    .home-page .person-node {
        min-height: 44px !important;
    }
}

.person-details h2 {
    color: #1E3C72;
    font-size: 1.2rem;
    margin: 0 0 12px;
    padding-right: 36px;
}
.person-facts {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}
.person-facts div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    padding: 8px 10px;
    background: #f6f9fe;
    border-radius: 8px;
    font-size: 0.92rem;
}
.person-facts dt { font-weight: 700; color: #1E3C72; margin: 0; }
.person-facts dd { margin: 0; color: #334155; }
.person-children {
    list-style: decimal;
    margin: 8px 0 0;
    padding: 0 0 0 1.4rem;
    display: block;
}
.person-children li {
    margin: 0 0 8px;
    padding: 0;
    line-height: 1.4;
    color: #334155;
}
.person-children a {
    color: #1E3C72;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.person-children a:hover {
    text-decoration: underline;
}

/* ===== STATS / FAMILIES ===== */
.home-page .stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.home-page .stat-card { padding: 12px 14px !important; }
.home-page .chart-main-container { padding: 14px !important; }
.home-page .bar-chart { min-height: 180px !important; }
.home-page .bar-container { width: 52px !important; }
.home-page .bar-label { font-size: 9px !important; }
.home-page .branch-table th,
.home-page .branch-table td { padding: 8px 10px !important; font-size: 0.86rem; }
.home-page .families-header { margin-bottom: 12px !important; }
.family-tabs { display: flex; flex-wrap: wrap; gap: 8px !important; }
.family-tab { min-width: 120px !important; padding: 8px 10px !important; }

/* ===== NEWS: 6 / 3 / 2 ===== */
.home-page .recent-posts-grid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 14px !important;
}
.home-page .recent-post-card {
    min-width: 0;
    background: #fff !important;
    border: 1px solid #e4ebf5;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(30,60,114,0.06);
    display: flex;
    flex-direction: column;
}
.home-page .recent-post-image {
    display: block !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    background: #1E3C72 !important;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
}
.home-page .recent-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.home-page .recent-post-image span {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px;
    text-align: center;
}
.home-page .recent-post-content {
    padding: 10px 11px 12px !important;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.home-page .recent-post-date {
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
    color: #2A5298 !important;
}
.home-page .recent-post-title {
    font-size: 0.86rem !important;
    margin: 0 0 6px !important;
    line-height: 1.3 !important;
}
.home-page .recent-post-title a {
    color: #1E3C72;
    text-decoration: none;
}
.home-page .recent-post-excerpt {
    display: block !important;
    font-size: 0.76rem !important;
    color: #5b6b86 !important;
    line-height: 1.4 !important;
    margin: 0 0 8px !important;
    flex: 1;
}
.home-page .read-more {
    align-self: flex-start;
    padding: 5px 10px !important;
    font-size: 0.74rem !important;
    background: #2A5298 !important;
    color: #fff !important;
    border-radius: 6px !important;
    text-decoration: none !important;
}
.home-page .news-more-wrap {
    text-align: center;
    margin-top: 16px;
}
.home-page .view-all-posts {
    display: inline-block;
    background: #1E3C72;
    color: #fff !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
}

@media (max-width: 1099px) {
    .exec-grid,
    .home-page .recent-posts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .home-page .video-row,
    .home-page .photo-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .home-history .history-chips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .history-title-cards {
        grid-template-columns: 1fr;
    }
    .home-history .history-lineage-grid {
        grid-template-columns: 1fr;
    }
    .home-page .stats-overview { grid-template-columns: 1fr; }
    .exec-avatar { width: 96px; height: 96px; }
}
@media (max-width: 640px) {
    .exec-grid,
    .home-page .recent-posts-grid,
    .home-page .video-row,
    .home-page .photo-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .home-page .section { padding: 16px 14px !important; }
    .home-history { padding: 14px; font-size: 0.94rem; }
    .home-history .history-chips { grid-template-columns: 1fr; }
    .home-history ol li { grid-template-columns: 28px 1fr; padding: 10px; }
    .exec-avatar { width: 84px; height: 84px; }
    .person-facts div { grid-template-columns: 1fr; gap: 2px; }
}

/* Homepage media sections */
.section-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.section-head-row .section-title {
    margin-bottom: 0;
}

.section-more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--clan-blue, #2A5298);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
}

.section-more-link:hover {
    color: var(--clan-navy, #1E3C72);
}

/* Homepage Hall of Fame uses gallery.css .hof-* (same as Media page) */
.home-page .home-hof-section .hof-grid {
    margin-bottom: 0;
}


/* === Homepage components (moved from index.php inline) === */
/* Branch Details Table */
    .branch-details-container {
        background: white;
        border-radius: 12px;
        padding: 25px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        border: 1px solid rgba(42, 82, 152, 0.1);
    }
    
    .details-title {
        color: #2A5298;
        font-size: 1.3rem;
        margin-bottom: 25px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .details-title i {
        color: #FFD700;
    }
    
    .branch-table-wrapper {
        overflow-x: auto;
        border-radius: 10px;
        border: 1px solid #e0e6ed;
    }
    
    .branch-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 900px;
    }
    
    .branch-table th {
        background: linear-gradient(135deg, #2A5298, #1E3C72);
        color: white;
        font-weight: 600;
        padding: 15px;
        text-align: left;
        font-size: 0.95rem;
    }
    
    .branch-table th:first-child {
        border-radius: 8px 0 0 0;
    }
    
    .branch-table th:last-child {
        border-radius: 0 8px 0 0;
    }
    
    .branch-table td {
        padding: 15px;
        border-bottom: 1px solid #e0e6ed;
        vertical-align: middle;
    }
    
    .branch-table tbody tr {
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .branch-table tbody tr:hover {
        background: rgba(42, 82, 152, 0.05);
        transform: scale(1.01);
        box-shadow: 0 2px 8px rgba(42, 82, 152, 0.1);
    }
    
    .rank {
        font-weight: 700;
        color: #2A5298;
        width: 60px;
    }
    
    .branch-name {
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .color-dot {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        display: inline-block;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .member-count {
        font-weight: 700;
        color: #2A5298;
        font-size: 1.1rem;
    }

    .count-emituba,
    .count-families,
    .count-individuals {
        font-weight: 600;
        color: #334155;
        text-align: center;
        white-space: nowrap;
    }
    
    .percentage {
        min-width: 150px;
    }
    
    .percentage-bar-container {
        position: relative;
        height: 28px;
        background: #f0f0f0;
        border-radius: 14px;
        overflow: hidden;
        display: flex;
        align-items: center;
    }
    
    .percentage-bar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 0;
        transition: width 0.5s ease;
    }
    
    .percentage-bar-container span {
        position: relative;
        z-index: 1;
        padding: 0 12px;
        font-size: 0.85rem;
        font-weight: 600;
        color: #333;
        width: 100%;
        text-align: right;
    }
    
    .actions {
        width: auto;
        min-width: 96px;
        white-space: nowrap;
    }

    .actions .row-actions {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .btn-view-branch {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #2A5298;
        font-size: 1.05rem;
        cursor: pointer;
        padding: 6px;
        border-radius: 6px;
        transition: all 0.3s ease;
        text-decoration: none;
        position: relative;
        z-index: 2;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        box-sizing: border-box;
    }
    
    .btn-view-branch:hover {
        background: #2A5298;
        color: white;
        transform: scale(1.1);
    }
    
    /* Families Section */
    .families-container {
        margin-top: 20px;
        background: linear-gradient(to bottom, #f8fafc, #f0f5ff);
        padding: 25px;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .families-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #e0e6ed;
    }
    
    .families-header h3 {
        color: #2A5298;
        margin: 0 0 5px 0;
        font-size: 1.3rem;
    }
    
    .families-header p {
        color: #666;
        margin: 0;
        font-size: 0.95rem;
    }
    
    .family-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .family-tab {
        padding: 12px 20px;
        background: linear-gradient(to right, #f8fafc, #f0f5ff);
        border: 1px solid #d1dbe5;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        color: #2A5298;
        transition: all 0.3s ease;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 130px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    .family-tab:hover {
        background: linear-gradient(to right, #e6f0ff, #d9e7ff);
        border-color: #a8c0e0;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(42, 82, 152, 0.1);
    }
    
    .family-tab.active {
        background: linear-gradient(135deg, #2A5298, #4a6ea9);
        color: white;
        border-color: #2A5298;
        box-shadow: 0 4px 12px rgba(42, 82, 152, 0.2);
    }
    
    .family-tab.active .family-branch {
        color: rgba(255,255,255,0.9);
    }
    
    .family-tab.active .family-count {
        background: white;
        color: #2A5298;
    }
    
    .family-name {
        font-size: 1rem;
        margin-bottom: 5px;
        text-align: center;
    }
    
    .family-branch {
        font-size: 0.75rem;
        font-weight: 500;
        opacity: 0.8;
        margin-bottom: 5px;
    }
    
    .family-count {
        background: #4a6ea9;
        color: white;
        border-radius: 20px;
        padding: 3px 12px;
        font-size: 0.75rem;
        margin-top: 5px;
        font-weight: 700;
    }
    
    /* Modal Styles */
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0,0,0,0.4);
    }
    
    .modal-content {
        background-color: #fff;
        margin: 5% auto;
        padding: 30px;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        width: 90%;
        max-width: 900px;
        max-height: 85vh;
        overflow-y: auto;
        position: relative;
    }
    
    .close-modal {
        color: #aaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
        position: absolute;
        right: 20px;
        top: 15px;
    }
    
    .close-modal:hover {
        color: #333;
    }
    
    .modal-title {
        color: #2A5298;
        margin-bottom: 20px;
        padding-right: 30px;
    }
    
    .member-count-badge {
        background: #2A5298;
        color: white;
        padding: 8px 15px;
        border-radius: 20px;
        display: inline-block;
        margin-bottom: 20px;
        font-weight: 600;
        font-size: 0.9rem;
    }
    
    .member-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .member-card {
        background: #f8fafc;
        border-radius: 8px;
        padding: 15px;
        border-left: 4px solid #2A5298;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    .member-card .member-name {
        font-weight: 700;
        color: #2A5298;
        margin-bottom: 10px;
        font-size: 1.1rem;
    }
    
    .member-detail-row {
        display: flex;
        margin-bottom: 5px;
        font-size: 0.9rem;
    }
    
    .member-detail-row .detail-label {
        font-weight: 600;
        color: #1E3C72;
        min-width: 70px;
    }
    
    .member-detail-row .detail-value {
        color: #555;
    }
    
    /* Family Tree Modal */
    #familyTreeContainer {
        width: 100%;
        height: 70vh;
        position: relative;
        background: #f9fbfd;
        border-radius: 8px;
        margin: 20px 0;
        overflow: auto;
        padding: 20px;
        border: 1px solid #d1dbe5;
    }
    
    .family-member-node {
        position: absolute;
        width: 180px;
        min-height: 90px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.08);
        padding: 12px;
        cursor: move;
        z-index: 10;
        transition: all 0.3s ease;
        border: 1px solid #d6e0f5;
    }
    
    .family-member-node:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        z-index: 100;
    }
    
    .member-node-content {
        text-align: center;
    }
    
    .family-member-node .member-name {
        font-weight: 600;
        color: #2A5298;
        margin-bottom: 5px;
        word-break: break-word;
    }
    
    .family-member-node .member-details {
        font-size: 0.8rem;
        color: #666;
    }
    
    .status-badge {
        display: inline-block;
        padding: 3px 10px;
        border-radius: 20px;
        font-size: 0.7rem;
        font-weight: 600;
        margin-top: 8px;
    }
    
    .status-badge.living {
        background: #4CAF50;
        color: white;
    }
    
    .status-badge.deceased {
        background: #e74c3c;
        color: white;
    }
    
    /* Empty States */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }
    
    .empty-state i {
        font-size: 4rem;
        color: #e0e0e0;
        margin-bottom: 20px;
    }
    
    .empty-state h4 {
        color: #2A5298;
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .empty-state p {
        color: #666;
        font-size: 1rem;
    }
    
    /* Loading States */
    .loading-state {
        text-align: center;
        padding: 40px;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #2A5298;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 20px;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    