/* Stylesheet utama Family Tree */

:root {
        --bg-dark: #2B2118;
        --bg-cream: #F6E0C8;
        --accent-green: #7a8b43;
        --accent-green-hover: #617032;
        --text-dark: #5D452A;
        --text-light: #f3e8d2;
        --border-color: #e2d3b7;
    }

    * {
        font-family: 'Poppins', sans-serif !important;
    }

    body.home-page {
        background-image: url('../images/homepage.png');
        background-size: cover;
        background-position: center;
        color: #3e2723;
        font-family: 'Poppins', sans-serif;
    }

    .wrapper {
        display: flex;
        min-height: 100vh;
        width: 100%;
    }

    #sidebar {
        width: 280px;
        min-width: 280px;
        background-color: var(--bg-dark);
        min-height: 100vh;
        padding: 0;

        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
        flex-shrink: 0;
        
        transition:
            width 0.3s ease,
            min-width 0.3s ease,
            opacity 0.2s ease;
        }

    body.sidebar-collapsed #sidebar {
        width: 0;
        min-width: 0;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-brand-container {
        height: 75px;
        padding: 0 15px;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    /* Ukuran logo dan judul sidebar */
    .sidebar-brand-container img {
        height: 48px !important;
        max-width: 70px;
        margin-right: 10px !important;
        object-fit: contain;
        flex-shrink: 0;
    }

    .sidebar-brand-container h4 {
        font-size: 1rem !important;
        letter-spacing: 0 !important;
        white-space: nowrap;
    }

    /* Penyesuaian saat sidebar berada pada layar sempit */
    @media (max-width: 768px) {
        .sidebar-brand-container {
            padding: 0 10px;
        }

        .sidebar-brand-container img {
            height: 42px !important;
            max-width: 60px;
            margin-right: 8px !important;
        }

        .sidebar-brand-container h4 {
            font-size: 0.88rem !important;
        }
    }

    .sidebar-menu-container {
        padding: 10px 15px 0 15px;
        white-space: nowrap;
    }

    #sidebar .nav-link {
        color: var(--text-light);
        padding: 11px 20px;
        border-radius: 10px;
        margin-bottom: 8px;
        font-size: 0.95rem;
        text-align: center;
        transition: all 0.3s;
    }

    #sidebar .nav-link:hover,
    #sidebar .nav-link.active {
        background-color: var(--accent-green);
        color: #ffffff;
        font-weight: 600;
    }

    #content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        transition: width 0.3s ease;
        background-color: var(--bg-dark);
    }

    #content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    }

    /* Area utama halaman setelah login */
    .main-workspace {
        background-color: var(--bg-dark);
        min-height: 0;
    }

    .topbar {
        height: 75px;
        background-color: #F6E0C8;
        color: var(--text-dark);
        padding: 0 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
    }

    .topbar-left {
        display: flex;
        align-items: center;
        min-width: 0;
    }

    .sidebar-toggle-btn {
        border: none;
        outline: none;
        background-color: transparent;
        color: #5c4333;
        font-size: 1.7rem;
        padding: 4px 8px;
        margin-right: 10px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition:
            color 0.2s ease,
            background-color 0.2s ease;
    }

    .sidebar-toggle-btn:hover {
        color: var(--accent-green);
        background-color: rgba(122, 139, 67, 0.12);
    }

    .topbar-slogan {
        color: #5c4333;
        font-size: 1.1rem;
        letter-spacing: 0.5px;
        font-weight: 700;
        white-space: nowrap;
    }

    .card-cream {
        background-color: var(--bg-cream);
        color: var(--text-dark);
        border-radius: 15px;
        border: none;
        padding: 25px;
    }

    .btn-earth {
        background-color: var(--accent-green);
        color: #ffffff;
        border: none;
        border-radius: 8px;
        padding: 8px 18px;
        font-weight: 600;
    }

    .btn-earth:hover {
        background-color: var(--accent-green-hover);
        color: #ffffff;
    }

    /* Profil pengguna di pojok kanan atas */
    .topbar-profile-link,
    .topbar-profile {
        flex-shrink: 0;
    }

    .topbar-profile-link {
        display: block;
    }

    /* Cegah slogan bertumpuk dengan profil */
    .topbar-slogan {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Saat area mengecil, tampilkan foto profil saja */
    @media (max-width: 1100px) {
        .topbar-profile-text {
            display: none;
        }

        .topbar-profile {
            gap: 0 !important;
        }
    }

    @media (max-width: 768px) {
        #sidebar {
            width: 240px;
            min-width: 240px;
        }

        body.sidebar-collapsed #sidebar {
            width: 0;
            min-width: 0;
        }

        .topbar {
            padding: 0 15px;
        }

        .topbar-slogan {
            font-size: 0.9rem;
        }

        .sidebar-toggle-btn {
            font-size: 1.5rem;
        }
    }

    body.login-page {
        background-color: #F6E0C8;
        background-image: url('../images/tree-illustration.png');
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
        min-height: 100vh;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    .login-card {
        background-color: #ffffff;
        border-radius: 20px;
        padding: 40px 35px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        width: 100%;
        max-width: 420px;
    }

    .btn-earth {
        background-color: #836947;
        color: #ffffff;
        border: none;
        border-radius: 10px;
        padding: 12px;
        font-weight: bold;
        letter-spacing: 1px;
        width: 100%;
    }

    .btn-earth:hover {
        background-color: #6a5336;
        color: #ffffff;
    }

    .form-control {
        border-radius: 8px;
        padding: 10px 15px;
        border: 1px solid #dcd3c1;
    }

    .form-control:focus {
        border-color: #836947;
        box-shadow: 0 0 0 0.2rem rgba(131, 105, 71, 0.25);
    }

    .input-group-text {
        background-color: #ffffff;
        border: 1px solid #dcd3c1;
        border-left: none;
        color: #a0937d;
    }
    
    .input-group .form-control {
        border-right: none;
    }

    a {
        color: #836947;
        text-decoration: none;
        }

    a:hover {
        text-decoration: underline;
    }

    /* REGISTER */
    * {
        box-sizing: border-box;
        font-family: 'Poppins', sans-serif;
    }

    body.register-page {
        background-image: url('../images/bg-daftar.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        color: #3e2723;
    }

    .register-container {
        width: 100%;
        max-width: 1100px;
        padding: 40px 30px;
    }

    .register-row {
        min-height: 650px;
        display: flex;
        align-items: center;
    }

    .register-left {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px 35px;
    }


    .register-left-title {
        font-size: clamp(1.6rem, 2.5vw, 2.2rem);
        font-weight: 700;
        line-height: 1.35;
        color: #3e2723;
        margin-bottom: 20px;
    }

    .register-illustration {
        display: block;
        width: 100%;
        max-width: 340px;
        height: auto;
        object-fit: contain;
        margin: auto;
    }

    .register-description {
        max-width: 430px;
        margin: 0 auto;
        color: #5c4333;
        font-size: 0.95rem;
        line-height: 1.8;
        font-weight: 600;
    }

    .register-card {
        background-color: #ffffff;
        border-radius: 20px;
        padding: 40px 35px;
        box-shadow:
            0 10px 30px
            rgba(0, 0, 0, 0.08);
        width: 100%;
        max-width: 430px;
        margin: 0 auto;
    }

    .form-label {
        font-size: 0.85rem;
        color: #7a6344;
        margin-bottom: 4px;
    }

    .form-control {
        border-radius: 8px;
        padding: 10px 15px;
        border: 1px solid #dcd3c1;
    }

    .form-control:focus {
        border-color: #836947;
        box-shadow:
            0 0 0 0.2rem
            rgba(131, 105, 71, 0.25);
    }

    .btn-earth {
       background-color: #836947;
        color: #ffffff;
        border: none;
        border-radius: 10px;
        padding: 12px;
        font-weight: bold;
        letter-spacing: 1px;
        width: 100%;
    }

    .btn-earth:hover {
        background-color: #6a5336;
        color: #ffffff;
    }

    /*LINK*/
    a {
        color: #836947;
        text-decoration: none;
    }

    a:hover {
        text-decoration: underline;
    }

    /*RESPONSIVE TABLET*/
    @media (max-width: 991.98px) {
        .register-container {
            max-width: 900px;
        }

        .register-left {
            padding: 20px;
        }

        .register-illustration {
            max-width: 290px;
        }

        .register-description {
            font-size: 0.9rem;
        }
    }

    /*RESPONSIVE MOBILE*/
    @media (max-width: 767.98px) {
        body.register-page {
            align-items: flex-start;
        }

        .register-container {
            padding: 35px 20px;
        }

        .register-row {
            min-height: auto;
        }

        .register-left {
            margin-bottom: 35px;
        }

        .register-left-title {
            margin-bottom: 15px;
        }

        .register-illustration {
            max-width: 260px;
            margin-bottom: 20px;
        }

        .register-description {
            max-width: 400px;
        }

        .register-card {
            max-width: 430px;
        }
    }

    /*MOBILE KECIL*/
    @media (max-width: 480px) {
        .register-container {
            padding: 25px 15px;
        }

        .register-card {
            padding: 30px 22px;
        }

        .register-illustration {
            max-width: 220px;
        }

        .register-description {
            font-size: 0.85rem;
        }
    }

    /* HOMEPAGE */
    * {
        font-family: 'Poppins', sans-serif !important;
    }
        
    .navbar {
        background-color: #5D452A;
    }

    .navbar-brand, .nav-link {
        color: #f3e9d2 !important;
    }

    .nav-link:hover {
        color: #889e54 !important;
    }

    .btn-custom {
        background-color: #6b8e23;
        color: #fff;
        border-radius: 8px;
        padding: 8px 20px;
    }

    .btn-custom:hover {
        background-color: #556b2f;
        color: #fff;
    }

    .tree-preview {
        background-color: #e6d5b8;
        border-radius: 12px;
        padding: 20px;
        border: 1px solid #d7ccc8;
    }

    body.home-page footer {
        background-color: #5D452A;
        color: #a1887f;
        padding: 20px 0;
        text-align: center;
    }

    html {
        scroll-behavior: smooth;
    }

    body.home-page {
        margin: 0;
        overflow-x: hidden;
    }

    .home-section {
        padding-top: 45px;
        padding-bottom: 45px;
    }

    .hero-section {
        padding-top: 35px;
        padding-bottom: 45px;
    }

    .container {
        max-width: 1200px;
    }

    .hero-title {
        font-size: clamp(2.2rem, 4.5vw, 4rem);
        line-height: 1.15;
    }

    .hero-description {
        font-size: clamp(1rem, 1.5vw, 1.25rem);
        line-height: 1.6;
    }

    .hero-image {
        width: 100%;
        max-width: 450px;
        height: auto;
        object-fit: contain;
        }

    .about-image {
        width: 100%;
        max-width: 380px;
        height: auto;
        object-fit: contain;
    }

    .about-text {
        font-size: clamp(0.95rem, 1.3vw, 1.15rem);
        line-height: 1.7;
    }

    .feature-card {
        background-color: #EDD9B4;
        border-radius: 12px;
        padding: 25px 20px;
        text-align: center;
        height: 100%;
    }

    @media (max-width: 991.98px) {
        .home-section {
            padding-top: 35px;
            padding-bottom: 35px;
        }

        .hero-section {
            padding-top: 30px;
            padding-bottom: 35px;
        }

        .hero-image {
            max-width: 380px;
        }

        .about-image {
            max-width: 320px;
        }
    }

    @media (max-width: 767.98px) {
        .home-section {
            padding-top: 30px;
            padding-bottom: 30px;
        }

        .hero-section {
            padding-top: 25px;
            padding-bottom: 30px;
        }

        .hero-content {
            text-align: center;
        }

        .hero-image {
            max-width: 330px;
            margin-top: 25px;
        }

        .about-image {
            max-width: 280px;
            margin-bottom: 20px;
        }

        .feature-card {
            max-width: 450px;
            margin-left: auto;
            margin-right: auto;
        }
    }

    /* Nama anggota sebagai link menuju halaman detail */
    .member-name-link {
        color: #2b1d12;
        text-decoration: none;
        font-weight: 700;
        transition:
            color 0.2s ease,
            text-decoration-color 0.2s ease;
    }

    .member-name-link:hover,
    .member-name-link:focus {
        color: var(--accent-green);
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* Judul halaman detail anggota */
    .member-detail-title {
        color: var(--text-light);
    }

    .member-detail-separator {
        color: #d4a055;
    }

    .member-detail-current {
        color: #ffffff;
    }

    /* =====================================================
        TOMBOL HALAMAN DETAIL ANGGOTA
    ===================================================== */

    .member-detail-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 10px;
    }

    .member-detail-actions .btn {
        width: auto;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 18px;
        white-space: nowrap;
    }


    /* Tombol edit */
    .btn-edit-member {
        background-color: #d4a373;
        border-color: #d4a373;
        color: #2b1d12;
    }

    .btn-edit-member:hover,
    .btn-edit-member:focus {
        background-color: #bd895b;
        border-color: #bd895b;
        color: #2b1d12;
    }


    /* Tombol hapus */
    .btn-delete-member {
        background-color: #902c1c;
        border-color: #902c1c;
        color: #ffffff;
    }

    .btn-delete-member:hover,
    .btn-delete-member:focus {
        background-color: #702116;
        border-color: #702116;
        color: #ffffff;
    }


    @media (max-width: 576px) {
        .member-detail-actions {
            justify-content: stretch;
        }

        .member-detail-actions .btn {
            flex: 1 1 100%;
        }
    }

    /*TABEL TEMA KELUARGA*/
    .relationship-card-header {
        background-color: #5D452A;
        color: #f3e8d2;
        border-color: #5D452A;
    }

    .relationship-card-body { 
        background-color: #f3e8d2; 
    }

    .table-family {
        --bs-table-bg: #fffaf0;
        --bs-table-color: #2b1d12;
        --bs-table-border-color: #d8c2a2;
        margin-bottom: 0;
    }

    .table-family thead th {
        background-color: #e2d3b7;
        color: #2b1d12;
        border-color: #c8b695;
    }

    .table-family tbody tr:nth-child(even) > * { 
        background-color: #f4e2c6; 
    }

    .table-family tbody tr:hover > * {
        background-color: #ead0a8; 
    }

    /* Modal konfirmasi hapus relasi */
    .relationship-delete-modal {
        background-color: var(--bg-cream);
        color: var(--text-dark);
        border: 0;
        border-radius: 20px;
    }

    .relationship-delete-icon {
        color: #902c1c;
        font-size: 3rem;
        line-height: 1;
    }

    .relationship-delete-detail {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 14px;
        background-color: #fffaf0;
        border: 1px solid var(--border-color);
        border-radius: 12px;
    }

    .relationship-delete-badge {
        padding: 5px 10px;
        background-color: #8b7448;
        color: #ffffff;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .btn-delete-relation,
    .btn-modal-delete,
    .btn-modal-cancel {
        width: auto;
    }

    /* Tombol outline sesuai tema */
    .btn-outline-earth {
        color: var(--text-dark);
        background-color: transparent;
        border: 1px solid var(--text-dark);
        border-radius: 8px;
        font-weight: 500;
    }

    .btn-outline-earth:hover {
        color: #ffffff;
        background-color: var(--text-dark);
        border-color: var(--text-dark);
    }
        
    /* Tombol aksi pada formulir relasi */
    .relationship-actions .btn-earth {
        width: auto;
        flex-shrink: 0;
    }

    .relationship-actions .btn-outline-earth {
        flex-shrink: 0;
    }

    /* Tampilan layar kecil */
    @media (max-width: 576px) {
        .relationship-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;

            width: 100%;
            gap: 12px;
        }

        .relationship-actions .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;

            width: auto;
            min-height: 46px;

            padding: 8px 18px;

            white-space: normal;
            line-height: 1.3;
        }
    }

    /* =====================================================
        VISUALISASI POHON KELUARGA
    ===================================================== */

    .family-tree-wrapper {
        width: 100%;
        padding: 20px 0;
    }


    /* Area scroll visualisasi */
    .family-tree-scroll {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        padding: 30px 0 60px;
        scroll-padding-left: 40px;
        scroll-padding-right: 40px;
    }


    /* =====================================================
        STRUKTUR DASAR POHON
    ===================================================== */

    .family-tree,
    .tree-children {
        position: relative;
        display: flex;
        justify-content: center;
        margin: 0;
        list-style: none;
    }


    /*
     * Lebar pohon mengikuti jumlah anggota.
     * Jika pohon kecil, lebarnya tetap memenuhi area layar.
     */
    .family-tree {
        width: max-content;
        min-width: 100%;
        padding: 20px 40px;
        box-sizing: border-box;
    }


    /*
     * Ruang antara satu generasi dan generasi berikutnya.
     *
     * 22px: garis dari orang tua menuju garis horizontal.
     * 23px: garis horizontal menuju kartu anak.
     */
    .tree-children {
        padding: 45px 0 0;
    }


    /* Setiap cabang keluarga */
    .tree-branch {
        position: relative;
        flex: 0 0 auto;
        padding: 0 18px;
        text-align: center;
    }


    /* =====================================================
        UNIT PASANGAN
    ===================================================== */

    .tree-family-unit {
        position: relative;
        z-index: 2;
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }


    /*
     * Kartu dan garis pasangan harus berada
     * di atas garis vertikal keturunan.
     */
    .tree-family-unit > .tree-member-card,
    .tree-family-unit > .tree-couple-line {
        position: relative;
        z-index: 1;
    }


    /* Garis horizontal antara pasangan */
    .tree-couple-line {
        display: block;
        width: 65px;
        height: 2px;
        background-color: #8b7448;
        flex-shrink: 0;
    }


    /* =====================================================
        GARIS MASUK KE UNIT PASANGAN
    ===================================================== */

    /*
     * Jika seorang anak sudah mempunyai pasangan,
     * lanjutkan garis dari bagian atas unit menuju
     * titik tengah garis pasangan.
     */
    .tree-children
    > .tree-branch
    > .tree-family-unit.has-spouse::before {
        content: "";
        position: absolute;
        top: -2px;
        left: 50%;
        width: 2px;
        height: calc(50% + 2px);
        background-color: #8b7448;
        transform: translateX(-1px);
        z-index: 0;
    }


    /* =====================================================
        GARIS KELUAR DARI PASANGAN
    ===================================================== */

    /*
     * Jika pasangan mempunyai anak, tarik garis
     * dari tengah pasangan hingga bagian bawah kartu.
     */
    .tree-family-unit.has-children::after {
        content: "";
        position: absolute;
        top: calc(50% - 1px);
        bottom: -1px;
        left: 50%;
        width: 2px;
        background-color: #8b7448;
        transform: translateX(-1px);
        z-index: 0;
    }


    /* =====================================================
        GARIS DARI ORANG TUA KE CABANG ANAK
    ===================================================== */

    /*
     * Garis vertikal dari bawah unit pasangan
     * menuju garis horizontal anak.
     */
    .tree-branch > .tree-children::before {
        content: "";
        position: absolute;
        top: -1px;
        left: 50%;
        width: 2px;
        height: 24px;
        background-color: #8b7448;
        transform: translateX(-1px);
    }


    /* =====================================================
       GARIS ANTARANAK
    ===================================================== */

    /*
     * Pseudo-element before dan after membentuk:
     * - garis horizontal antaranak;
     * - garis vertikal ke masing-masing kartu.
     */
    .tree-children > .tree-branch::before,
    .tree-children > .tree-branch::after {
        content: "";
        position: absolute;
        top: -23px;
        width: 50%;
        height: 23px;
        border-top: 2px solid #8b7448;
    }

    /* Setengah garis sebelah kiri */
    .tree-children > .tree-branch::before {
        right: 50%;
    }

    /*
     * Setengah garis sebelah kanan sekaligus
     * garis vertikal menuju kartu anak.
     */
    .tree-children > .tree-branch::after {
        left: 50%;
        border-left: 2px solid #8b7448;
    }


    /* =====================================================
       ANAK PERTAMA
    ===================================================== */

    /*
     * Anak pertama tidak membutuhkan garis
     * ke arah kiri.
     */
    .tree-children > .tree-branch:first-child::before {
        border-top: none;
    }

    /* =====================================================
       ANAK TERAKHIR
    ===================================================== */

    /*
     * Anak terakhir tidak membutuhkan garis
     * ke arah kanan.
     */
    .tree-children > .tree-branch:last-child::after {
        border-top: none;
    }


    /*
     * Lengkungan dari garis horizontal kiri
     * menuju kartu anak terakhir.
     */
    .tree-children > .tree-branch:last-child::before {
        border-right: 2px solid #8b7448;
    }


    /* =====================================================
       HANYA SATU ANAK
    ===================================================== */

    /*
     * Jika hanya ada satu anak, tidak perlu
     * menggambar garis horizontal.
     */
    .tree-children > .tree-branch:only-child::before {
        display: none;
    }


    .tree-children > .tree-branch:only-child::after {
        left: 50%;
        width: 0;
        border-top: none;
        border-left: 2px solid #8b7448;
        border-radius: 0;
    }


    /* =====================================================
       KARTU ANGGOTA
    ===================================================== */

    .tree-member-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 160px;
        min-height: 165px;
        padding: 18px 14px;
        background-color: #f6e0c8;
        color: var(--text-dark);
        border: 2px solid #8b7448;
        border-radius: 22px;
        box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
        box-sizing: border-box;
    }


    /* Foto dan placeholder */
    .tree-member-photo,
    .tree-member-placeholder {
        width: 82px;
        height: 82px;
        margin-bottom: 12px;
        border: 3px solid #ffffff;
        border-radius: 50%;
        box-sizing: border-box;
    }

    /* Foto anggota */
    .tree-member-photo {
        display: block;
        object-fit: cover;
    }

    /* Ikon jika anggota tidak mempunyai foto */
    .tree-member-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #d8c2a2;
        color: var(--text-dark);
        font-size: 2.5rem;
    }

    /* Nama anggota */
    .tree-member-name {
        font-size: 0.9rem;
        line-height: 1.3;
        font-weight: 700;
        overflow-wrap: anywhere;
    }


    /* =====================================================
        RESPONSIVE
    ===================================================== */

    @media (max-width: 768px) {
        .family-tree {
            padding-right: 25px;
            padding-left: 25px;
        }

        .tree-branch {
            padding-right: 10px;
            padding-left: 10px;
        }

        .tree-member-card {
            width: 130px;
            min-height: 145px;
            padding: 14px 10px;
        }

        .tree-member-photo,
        .tree-member-placeholder {
            width: 65px;
            height: 65px;
        }

        .tree-couple-line {
            width: 35px;
        }

        .tree-member-name {
            font-size: 0.82rem;
        }
    }

    /* Modal konfirmasi hapus anggota */
    .delete-modal-content {
        background-color: var(--bg-cream);
        color: var(--text-dark);
        border: 0;
        border-radius: 20px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
    }

    .delete-modal-icon {
        color: #902c1c;
        font-size: 3rem;
    }

    .btn-modal-delete {
        width: auto;
        background-color: #902c1c;
        border-color: #902c1c;
        color: #ffffff;
    }

    .btn-delete-member:hover,
    .btn-modal-delete:hover {
        background-color: #702116;
        border-color: #702116;
        color: #ffffff;
    }

    .btn-modal-cancel {
        width: auto;
        background-color: transparent;
        border: 1px solid var(--text-dark);
        color: var(--text-dark);
    }

    .btn-modal-cancel:hover,
    .btn-modal-cancel:focus {
        background-color: var(--text-dark);
        border-color: var(--text-dark);
        color: #ffffff;
    }

    .search-title {
        color: var(--text-light);
    }

    /* =====================================================
        HASIL PENCARIAN ANGGOTA
    ===================================================== */

    .search-result-card {
        background-color: #ffffff;
        color: var(--text-dark);
    }

    .search-member-link {
        color: var(--text-dark);

        font-weight: 700;
        text-decoration: none;

        transition:
            color 0.2s ease,
            text-decoration-color 0.2s ease;
    }

    .search-member-link:hover,
    .search-member-link:focus {
        color: var(--accent-green);

        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* Kartu anggota sebagai link ke halaman detail */
    .tree-member-link {
        color: var(--text-dark);
        text-decoration: none;
        cursor: pointer;

        transition:
            background-color 0.2s ease,
            border-color 0.2s ease,
            box-shadow 0.2s ease;
    }

    .tree-member-link:hover {
        color: var(--text-dark);
        text-decoration: none;

        background-color: #f9e8ce;
        border-color: var(--accent-green);

        box-shadow:
            0 7px 18px rgba(0, 0, 0, 0.22);
    }

    .tree-member-link:focus-visible {
        color: var(--text-dark);

        outline: 3px solid var(--accent-green);
        outline-offset: 4px;
    }

    /* =====================================================
        FORM ANGGOTA
    ===================================================== */

    .theme-form-header {
        background-color: #5d452a;
        color: #f3e8d2;

        border-color: #5d452a;
    }

    .theme-form-body {
        background-color: #fffaf0;
        color: var(--text-dark);
    }


    /* Input form */
    .theme-form-body .form-control,
    .theme-form-body .form-select {
        background-color: #ffffff;
        color: #2b1d12;

        border: 1px solid #d8c2a2;
        border-radius: 9px;
    }

    .theme-form-body .form-control:focus,
    .theme-form-body .form-select:focus {
        border-color: var(--accent-green);

        box-shadow:
            0 0 0 0.2rem
            rgba(122, 139, 67, 0.2);
    }

    .theme-form-body .form-label {
        color: var(--text-dark);
    }


    /* Tombol bagian bawah */
    .member-form-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    .member-form-actions .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: auto;
        min-height: 46px;

        padding: 8px 18px;
    }


     /* Saat ruang halaman mengecil */
    @media (max-width: 1100px) {
        .member-form-actions {
            flex-direction: column;
            align-items: stretch;
            width: 100%;
        }

        .member-form-actions .btn {
            width: 100%;
            max-width: 100%;    
            white-space: normal;
    }
}