:root {
    /* Palet Hijau Modern (Emerald/Nature) */
    --primary: #10b981;          /* Emerald Green */
    --primary-hover: #059669;    /* Darker Green */
    --bg-light: #f8fafc;         /* Slate Light */
    --sidebar-width: 260px;
    --gradient-top: linear-gradient(135deg, #065f46, #10b981); /* Hijau Gradasi */
    --accent-light: #ecfdf5;     /* Hover Green Light */
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body { 
    background: var(--bg-light); 
    transition: 0.3s; 
    color: #334155;
}

/* TOPBAR */
.topbar {
    height: 65px;
    background: var(--gradient-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    color: white;
    position: fixed;
    width: 100%;
    z-index: 1000;
    /* Box shadow disesuaikan ke nuansa hijau lembut */
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.header-left { display: flex; align-items: center; gap: 20px; }
.menu-btn { cursor: pointer; font-size: 20px; }

.brand-logo { 
    height: 35px; 
}

/* LAYOUT */
.layout { display: flex; padding-top: 65px; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    height: calc(100vh - 65px);
    position: fixed;
    left: -260px; /* <--- RUBAH BARIS 59: Dari 0 menjadi -260px */
    border-right: 1px solid #e2e8f0;
    transition: 0.3s;
    overflow-y: auto;
}

/* Tambahkan ini setelah baris 61 */
.sidebar.active {
    left: 0 !important;
}

.sidebar ul { list-style: none; padding: 10px 0; }

.sidebar ul li a, .dropdown-btn {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    cursor: pointer;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
}

.sidebar ul li a i, .dropdown-btn i:first-child {
    width: 30px;
    font-size: 17px;
    color: var(--primary); /* Icon sekarang menggunakan hijau utama */
}

.fa-chevron-down {
    margin-left: auto;
    font-size: 11px !important;
    color: #94a3b8 !important;
    transition: 0.3s;
}

.sidebar ul li a:hover, .dropdown-btn:hover {
    background: var(--accent-light);
    color: var(--primary);
}

.dropdown-container {
    display: none;
    background-color: #f1f5f9;
    padding-left: 15px;
}

.dropdown-container a {
    padding: 10px 25px !important;
    font-size: 13.5px !important;
    border-left: 2px solid #cbd5e1;
}

.dropdown-container a:hover {
    border-left: 2px solid var(--primary); /* Border kiri saat hover menjadi hijau */
    background: #e2e8f0;
}

.rotate { transform: rotate(180deg); }

/* CONTENT AREA */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    transition: 0.3s;
}

/*================================================================ untuk menu dashboard

/* Dashboard Specific Styles */
.dashboard-header { margin-bottom: 25px; }

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 5px solid var(--primary);
    transition: 0.3s;
}

.stat-card:hover { transform: translateY(-5px); }
.stat-card h4 { color: #666; font-size: 14px; margin-bottom: 10px; text-transform: uppercase; }
.stat-card p { font-size: 22px; font-weight: bold; color: var(--primary); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.chart-container, .recent-activity {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.activity-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.activity-table th { text-align: left; padding: 10px; border-bottom: 2px solid #eee; color: #666; }
.activity-table td { padding: 12px 10px; border-bottom: 1px solid #eee; font-size: 14px; }

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Container utama untuk chart agar tingginya tetap, grafik untuk di dashboard*/
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    height: 350px; /* Tentukan tinggi tetap di sini */
    width: 100%;
}

/* Memastikan canvas mengikuti tinggi container */
.chart-container canvas {
    max-height: 100% !important;
    width: 100% !important;
}


/*================================================================ untuk menu update profile

/* Profile & Form Styles */
.profile-container {
    max-width: 1000px;
    margin-top: 20px;
}

.form-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.form-card h3 {
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 2px solid #f5f6fa;
    padding-bottom: 10px;
    font-size: 18px;
}

.form-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.form-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fcfcfc;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(214,0,0,0.1);
}

.form-group input[readonly] {
    background: #f1f1f1;
    cursor: not-allowed;
}

.form-actions {
    text-align: right;
    margin-top: 30px;
    margin-bottom: 50px;
}

.btn-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-save:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Mengatur Grid agar responsif (3 kolom di desktop, 1 kolom di HP) */
.form-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

/* Memastikan card putih terlihat jelas */
.form-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-top: 4px solid #d60000; /* Garis merah di atas card */
}

/* Styling Input agar konsisten */
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fcfcfc;
    font-size: 14px;
}

.form-group input[readonly] {
    background: #f1f1f1;
    color: #666;
}


/*================================================================ untuk menu ganti password

/* Ganti Password Specific Styles */
.main-wrapper { 
    padding: 15px; 
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Mencegah elemen di dalam meluap ke samping */
}

.header-title {
    text-align: center;
    margin-bottom: 20px;
}

.header-title h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.password-requirements { 
    margin-top: 20px; 
    padding: 15px; 
    background: #fff9f9; 
    border-radius: 8px; 
    border-left: 4px solid var(--primary);
    word-wrap: break-word; /* Memastikan teks panjang tidak merusak layout */
}

.password-requirements p { margin: 0 0 8px 0; font-size: 13px; color: #444; }
.password-requirements ul { margin: 0; padding-left: 20px; font-size: 12px; color: #666; }

/* Wrapper input agar selalu mengikuti lebar container */
.input-wrapper { 
    width: 100%; 
}

.input-wrapper input {
    width: 100%;
    box-sizing: border-box; /* Menghitung padding di dalam lebar 100% */
}

.action-area { 
    text-align: left; 
    margin-top: 25px; 
    width: 100%;
}

/* Responsivitas untuk Tombol dan Grid */
@media (min-width: 768px) {
    .header-title h2 { font-size: 24px; }
    .btn-save { width: auto; } 
    .form-group-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 Kolom di desktop */
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .btn-save { 
        width: 100%; /* Tombol lebar penuh di HP agar mudah ditekan */
    }
    .form-group-grid {
        display: flex;
        flex-direction: column; /* 1 Kolom di HP */
        gap: 15px;
    }
    .form-card {
        padding: 15px; /* Kurangi padding card agar ruang lebih luas */
    }
}

#password-container {
    max-width: 600px;     /* Lebar ramping seperti kodetrx */
    margin: 0 auto;       /* Posisi tengah */
    width: 95%;
}

/* Memastikan form berderet ke bawah (satu kolom) */
.form-group-single {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#password-container .form-card {
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Responsivitas Tombol */
#password-container .btn-save {
    width: 100%; /* Tombol lebar penuh agar konsisten di layout ramping */
    padding: 14px;
    font-size: 16px;
}

@media (min-width: 768px) {
    #password-container {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    #password-container {
        width: 100%;
        padding: 0;
    }
    #password-container .form-card {
        padding: 20px;
    }
}


/*================================================================ untuk menu kodetrx

/* ================================================================= 
   Kode Transaksi Specific Styles (Mobile Friendly)
   ================================================================= */

.transaction-info {
    display: flex;
    gap: 12px;
    background: #fff9f9;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-bottom: 20px;
    text-align: left;
}

.info-icon {
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
}

.info-text strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.info-text p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Memastikan input kode besar dan berada di tengah */
#transaction_code {
    width: 100%;
    box-sizing: border-box; /* Fix untuk scroll samping */
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
    background: #f8f9fa;
}

.helper-note {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    font-style: italic;
    text-align: center;
    display: block;
}

.btn-request {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    width: 100%; /* Full width di HP */
    transition: 0.3s;
}

.btn-request:hover {
    background: var(--primary-hover);
}

@media (min-width: 768px) {
    .btn-request {
        width: auto; /* Tombol menyesuaikan teks di desktop */
        padding: 12px 30px;
    }
}

/* Targetkan ID spesifik agar tidak merusak halaman profil/lainnya */
#trx-container {
    max-width: 600px;     /* Lebar proporsional sekitar 60% di PC */
    margin: 0 auto;       /* Posisi di tengah */
    width: 95%;           /* Fleksibel untuk layar tablet */
}

/* Memastikan elemen di dalam halaman TRX rapi di HP */
@media (max-width: 768px) {
    #trx-container {
        width: 100%;      /* Kembali ke lebar penuh di HP */
        max-width: 100%;
        padding: 0;
    }
    
    #trx-container .form-card {
        padding: 15px;    /* Padding lebih ramping khusus di HP */
    }
}

/* Memastikan teks info di halaman TRX tetap terbaca dengan baik */
#trx-container .transaction-info {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Styling Khusus Halaman Keamanan Transaksi */
.transaction-info {
    display: flex;
    align-items: center;
    background: #fff5f5;
    border: 1px solid #ffebeb;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    gap: 15px;
    margin-bottom: 20px;
}

.info-icon i {
    font-size: 24px;
    color: var(--primary);
}

.info-text p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.input-custom-trx {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    background: #fafafa;
    outline: none;
    transition: 0.3s;
}

.btn-request {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-request:hover {
    background: #b80000;
    transform: translateY(-2px);
}

.helper-note {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/*================================================================ untuk menu registrasi

/* ================================================================= 
   Registrasi Specific Styles (Mobile Friendly)
   ================================================================= */

#reg-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Tabel Stok Responsif */
.stock-table-container { 
    overflow-x: auto; 
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.stock-table { 
    width: 100%; 
    max-width: 400px; 
    border-collapse: collapse; 
    border: 1px solid #ddd; 
}

.stock-table th { background: #f8f9fa; padding: 10px; border: 1px solid #ddd; font-size: 13px; }
.stock-table td { padding: 10px; text-align: center; border: 1px solid #ddd; background: #eff3ff; font-weight: bold; }

/* Input Select & Date Group */
.date-select-group {
    display: flex;
    gap: 5px;
}

.date-select-group select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #eff3ff;
}

.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #eff3ff;
    width: 100%;
}

.helper-text { font-size: 11px; color: #d60000; margin-top: 4px; }

/* Tombol Aksi Registrasi */
.action-buttons-reg { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin-top: 30px; 
}

.btn-save-reg, .btn-clear-reg { 
    padding: 10px 30px; 
    border-radius: 4px; 
    border: 1px solid #ccc; 
    cursor: pointer; 
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-save-reg { background: #e0e0e0; color: #333; }
.btn-clear-reg { background: #f8f8f8; color: #666; }

.btn-save-reg:hover { background: var(--primary); color: white; border-color: var(--primary); }

.footer-note {
    text-align: center; 
    font-size: 12px; 
    color: #888; 
    margin: 25px 0 50px 0;
}

@media (max-width: 768px) {
    .action-buttons-reg {
        flex-direction: column;
    }
    .btn-save-reg, .btn-clear-reg {
        width: 100%;
    }
}


/*================================================================ untuk menu genealogy

/* ================================================================= 
   Genealogy & Network Tree Styles
   ================================================================= */

.statement-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.filter-section {
    background: #fcfcfc;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

.input-custom {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
    transition: 0.3s;
}

.input-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(214, 0, 0, 0.1);
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

/* Struktur Pohon Jaringan */
.tree-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 30px;
    -webkit-overflow-scrolling: touch;
}

.tree {
    display: inline-block;
    min-width: 100%;
    text-align: center;
}

.tree ul {
    padding-top: 20px; 
    position: relative;
    display: flex;
    justify-content: center;
}

.tree li {
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
}

.tree li::before, .tree li::after {
    content: '';
    position: absolute; top: 0; right: 50%;
    border-top: 2px solid #ccc;
    width: 50%; height: 20px;
}

.tree li::after {
    right: auto; left: 50%;
    border-left: 2px solid #ccc;
}

.tree li:only-child::after, .tree li:only-child::before { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid #ccc; border-radius: 0 5px 0 0; }
.tree li:first-child::after { border-radius: 5px 0 0 0; }
.tree ul ul::before {
    content: '';
    position: absolute; top: 0; left: 50%;
    border-left: 2px solid #ccc;
    width: 0; height: 20px;
}

/* Node Style */
.node-box {
    display: inline-block;
    width: 130px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.node-icon { padding: 10px 0; }
.node-icon i { font-size: 22px; color: var(--primary); }

.node-id {
    background: #2ecc71;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 0;
}

.node-id.special { background: #e74c3c; }
.node-id.director { background: #3498db; }

.node-name {
    font-size: 10px;
    padding: 7px 3px;
    color: #333;
    line-height: 1.4;
    min-height: 45px;
}

.node-footer {
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    font-size: 10px;
    font-weight: bold;
    padding: 5px 0;
    background: #f9f9f9;
}

@media (max-width: 768px) {
    .filter-controls { flex-direction: column; align-items: stretch; }
    .input-custom { width: 100%; }
}


/*================================================================ untuk menu forecast

/* ================================================================= 
   FORECAST & REPORT STYLES (Restoring Original Look)
   ================================================================= */

.statement-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.filter-section {
    background: #fcfcfc;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

/* User Info Box di atas tabel */
.user-info-mini {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    border-right: 2px solid #eee;
    padding-right: 25px;
}

/* Toolbars & Pagination */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.page-info { font-size: 13px; color: #666; }
.pagination-controls { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.page-input { width: 40px; text-align: center; border: 1px solid #ddd; padding: 4px; border-radius: 4px; }
.btn-nav { background: #f8f9fa; border: 1px solid #ddd; padding: 5px 10px; cursor: pointer; border-radius: 4px; }

/* Table Styling */
.table-responsive { width: 100%; overflow-x: auto; }
.table-report { width: 100%; border-collapse: collapse; margin-top: 10px; }
.table-report th { 
    background: var(--primary); 
    color: white; 
    padding: 15px 10px; 
    text-align: center; 
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.1);
}
.table-report td { 
    padding: 12px 10px; 
    border-bottom: 1px solid #eee; 
    text-align: center; 
    font-size: 13px;
    color: #555;
}
.table-report tbody tr:hover { background-color: #f9f9f9; }
.txt-bold { font-weight: bold; color: #333; }

/* Modal Detail Table */
.table-report-detail { width: 100%; border-collapse: collapse; }
.table-report-detail thead th { background: var(--primary); color: white; padding: 12px; font-size: 13px; }
.table-report-detail .sub-header th { background: #f1f1f1 !important; color: #333 !important; border: 1px solid #ddd !important; }
.table-report-detail td { padding: 10px; border: 1px solid #eee; text-align: center; }
.row-total-detail td { font-weight: bold; background: #f9f9f9; padding: 15px; border-top: 2px solid #eee; }

/* Modal Box */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 15px;
    width: 80%;
    max-width: 850px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 9999 !important; /* Nilai sangat tinggi agar di atas sidebar/topbar */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}

/* --- Styling Modal Baru --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px); /* Efek blur latar belakang */
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    margin: 50px auto;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s ease-out;
    position: relative;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.btn-close-modal:hover { color: #d60000; }

.modal-body { padding: 20px; }

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* --- UI Banner & Table --- */
.detail-summary-banner {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #d60000;
}

.summary-item { display: flex; justify-content: space-between; align-items: center; }
.summary-item span { font-size: 13px; color: #666; }
.summary-item strong { font-size: 18px; color: #d60000; }

.table-report-detail {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-report-detail th {
    background: #d60000;
    color: #fff;
    padding: 10px;
    border: 1px solid #b80000;
    text-align: center;
    font-size: 12px;
}

.table-report-detail .sub-header th {
    background: #b80000; /* Warna lebih gelap untuk sub-header */
    font-size: 11px;
}

.table-report-detail td {
    padding: 12px 10px;
    border: 1px solid #eee;
    text-align: center;
    color: #444;
}

.text-left { text-align: left !important; }
.text-primary { color: #d60000; font-weight: bold; }

.row-total-detail td {
    background: #fdf2f2;
    font-weight: bold;
    padding: 15px 10px;
    border-top: 2px solid #d60000;
}

.total-amount { font-size: 16px; color: #d60000; }

/* Responsif */
@media (max-width: 480px) {
    .modal-content { margin: 20px auto; width: 95%; }
    .table-report-detail { font-size: 11px; }
    .summary-item strong { font-size: 16px; }
}

/*================================================================ untuk menu forecastTSM

/* ================================================================= 
   FORECAST TSM SPECIFIC STYLES (New Additions)
   ================================================================= */

/* Perataan kanan khusus angka pada tabel TSM */
.table-statement tbody td.txt-right {
    text-align: right;
    padding-right: 15px;
}

/* TSM Progress Bar */
.tsm-progress-bg {
    background: #eee;
    border-radius: 10px;
    height: 10px;
    width: 100%;
    max-width: 120px;
    margin: 5px auto;
    overflow: hidden;
    border: 1px solid #ddd;
}

.tsm-progress-fill {
    background: linear-gradient(90deg, #ff4d4d, var(--primary));
    height: 100%;
    border-radius: 10px;
}

/* Status Badge */
.badge-active {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

/* Button Action Detail TSM */
.btn-action-tsm {
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-action-tsm:hover {
    background: var(--primary);
    color: #fff;
}

/* ================================================================= 
   PERBAIKAN HEADER MUTASI PIN (D/K)
   ================================================================= */

/* Pastikan header utama (table-report) tetap merah normal */
.table-report thead th {
    background-color: var(--primary); /* Merah utama dashboard Anda */
    color: white;
    /* ... style lainnya ... */
}

/* Mengubah tampilan baris sub-header (D/K) */
.table-report thead tr.sub-header th {
    /* MENGGUNAKAN SATU WARNA dasar merah: */
    /* Teknik 1: Merah yang sedikit lebih gelap (Direkomendasikan) */
    background-color: #b80000 !important; /* Sesuaikan agar sedikit lebih gelap dari --primary */
    
    /* Atau Teknik 2: Gunakan opacity agar merah dasar terlihat gelap (Alternatif) */
    /* background-color: rgba(0, 0, 0, 0.15) !important; */

    /* Warna teks D dan K dibuat putih agak transparan agar halus tapi tetap terbaca */
    color: rgba(255, 255, 255, 0.8) !important;
    
    /* Menghilangkan border aneh dan menyatukan garis */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    
    /* Ukuran font sedikit dikecilkan agar hierarki jelas */
    font-size: 11px !important;
    text-transform: uppercase;
    font-weight: bold;
    padding: 8px 5px !important;
}

/* Memastikan teks D dan K berada di tengah */
.table-report thead tr.sub-header th.text-center {
    text-align: center;
}

/* Perbaikan Sub-Header (Kiri/Kanan atau D/K) agar satu warna dengan tema */
.table-report-detail thead tr.sub-header th,
.table-report thead tr.sub-header th {
    /* Menggunakan merah yang sedikit lebih gelap dari header utama */
    background-color: #b80000 !important; 
    
    /* Warna teks putih transparan agar terlihat halus */
    color: rgba(255, 255, 255, 0.9) !important;
    
    /* Menghilangkan kesan terpisah dengan border halus */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    
    font-size: 11px !important;
    text-transform: uppercase;
    font-weight: 600;
    padding: 8px 5px !important;
}

/* Memastikan teks tetap di tengah */
.text-center {
    text-align: center;
}


/*================================================================ untuk menu Panduan Member

/* ================================================================= 
   PANDUAN MEMBER STYLES
   ================================================================= */
.header-section {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.header-section h2 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-section p {
    color: #777;
    margin-top: 5px;
    font-size: 14px;
}

.guide-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.guide-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    border-top: 4px solid var(--primary);
    transition: transform 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-5px);
}

.card-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #333;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}

.guide-card h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    background: #f0f4ff;
    color: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 14px;
    border: 1px solid rgba(214, 0, 0, 0.1);
}

.step-item p {
    margin: 0;
    color: #444;
    line-height: 1.6;
    font-size: 14px;
}

.badge-red {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.info-box {
    margin-top: 20px;
    background: #fff5f5;
    border: 1px dashed var(--primary);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    color: #b80000;
    font-size: 13px;
}

/* other

/* Pastikan topbar membagi ruang dengan benar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mengatur ID dan Nama jadi satu baris */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 10px; /* Jarak antara teks dan ikon user */
    color: white;
}

.user-inline-details {
    display: flex;
    align-items: center;
    gap: 8px; /* Jarak antara ID, separator, dan Nama */
}

.user-id {
    font-size: 12px;
    font-weight: bold;
    opacity: 0.9;
}

.user-separator {
    opacity: 0.5;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.header-user-info i {
    font-size: 24px;
}

/* Penyesuaian untuk layar kecil agar tidak sesak */
@media (max-width: 600px) {
    .user-id, .user-separator {
        display: none; /* Sembunyikan ID di HP agar hanya Nama yang muncul */
    }
}

.dob-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
}

.dob-select {
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
}

@media (max-width: 480px) {
    .dob-wrapper {
        flex-wrap: wrap; /* Pada HP sangat kecil, baru boleh turun baris */
    }
    .dob-select, #full_dob {
        font-size: 12px;
    }
}

/* Container Utama */
.header-section h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Container Toolbar - Kunci utamanya ada di sini */
.table-action-toolbar {
    display: flex;
    justify-content: space-between; /* Mendorong satu ke kiri, satu ke kanan */
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap; /* Supaya rapi di HP */
    gap: 15px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Styling Input & Select */
.select-custom-small {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.btn-refresh-modern {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.3s;
}

.btn-refresh-modern:hover {
    background: #27ae60;
}

/* Pagination Modern */
.pagination-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.input-page-small {
    width: 45px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.nav-buttons-group {
    display: flex;
    gap: 4px;
    margin-left: 5px;
}

.btn-nav-small {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.btn-nav-small:hover {
    background: #eee;
}

/* Styling Detail Button */
.btn-detail-modern {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

/* Responsif Mobile (HP) */
@media (max-width: 768px) {
    .table-action-toolbar {
        flex-direction: column; /* Berubah jadi tumpuk atas-bawah di HP */
        align-items: flex-start;
    }
    
    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Pastikan modal berada di lapisan teratas */
.modal {
    display: none; 
    position: fixed; 
    z-index: 9999 !important; /* Nilai tinggi agar di atas topbar/sidebar */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); /* Background gelap transparan */
    overflow-y: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.modal-header {
    padding: 15px 20px;
    background: linear-gradient(90deg, #b80000, #ff3d3d);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.btn-search-modern {
    background-color: var(--primary); /* Merah khas MERCI */
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px; /* Sudut sedikit membulat agar modern */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px; /* Jarak antara ikon dan teks */
    transition: all 0.3s ease; /* Efek transisi halus */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Efek saat kursor diarahkan ke tombol (Hover) */
.btn-search-modern:hover {
    background-color: var(--primary-hover); /* Warna sedikit lebih terang */
    transform: translateY(-1px); /* Tombol sedikit naik */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Efek saat tombol diklik (Active) */
.btn-search-modern:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mengatur ukuran ikon di dalam tombol */
.btn-search-modern i {
    font-size: 13px;
}

/* Container Utama tetap menggunakan warna hijau muda */
.tree-sponsor-vertical {
    background-color: #dcfce7; 
    padding: 20px;
    border-radius: 8px;
    display: block !important; /* Pastikan tidak flex ke samping */
}

/* Memastikan setiap baris member berjejer horizontal (LV, Icon, ID, Nama) */
.node-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    margin-bottom: 5px;
    width: 100%;
}

/* Kotak ID Biru agar tetap rapi */
.node-id-box {
    border: 1.5px solid #2563eb !important;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 13px;
    color: #000;
    display: inline-block;
}

/* PENTING: Container anak harus berada DI BAWAH node induknya */
.branch-container {
    display: block !important; /* Memaksa list anak turun ke bawah */
    margin-left: 45px; /* Memberikan indentasi/jarak ke kanan untuk level berikutnya */
    border-left: 1px dashed #888; /* Garis vertikal putus-putus */
    padding-left: 15px;
    margin-top: 5px;
    margin-bottom: 10px;
}

/* Indikator Level */
.lv-indicator {
    min-width: 35px;
    font-size: 11px;
    font-weight: bold;
    color: #444;
}

.node-icon {
    color: #10b981; /* Warna hijau untuk icon user */
    font-size: 18px;
}

.branch-container {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.icon-rotate {
    transform: rotate(-90deg);
}

/* Tambahkan di baris paling akhir file style.css */
@media (min-width: 769px) {
    .sidebar {
        left: 0; /* Di komputer sidebar selalu muncul */
    }
}

@media (max-width: 768px) {
    .content {
        margin-left: 0 !important; /* Di HP konten memenuhi layar */
    }
}