/* ========================================
   RESPONSIVE MOBILE-FIRST DESIGN
======================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh; padding: 8px; line-height: 1.6;
}
.container {
    width: 100%; max-width: 1200px; margin: 0 auto; background: white;
    border-radius: 15px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); overflow: hidden;
}
.header {
    background: linear-gradient(135deg, #4CAF50, #45a049); color: white;
    padding: 25px 20px; text-align: center;
}
.header h1 { font-size: clamp(24px, 5vw, 36px); margin-bottom: 8px; font-weight: 700; }
.header p { opacity: 0.9; font-size: 13px; }

/* DASHBOARD 2026 */
.dashboard-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
    margin-bottom: 25px; padding: 15px; background: #f8fafc; border-radius: 12px;
}
.stat-card { flex: 1; text-align: center; padding: 12px; background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.month-card {
    background: white; border: 2px solid #e2e8f0; border-radius: 12px; padding: 15px; cursor: pointer;
    transition: all 0.2s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.month-card:hover { border-color: #3b82f6; box-shadow: 0 8px 20px rgba(59,130,246,0.15); transform: translateY(-1px); }
.month-card.active { border-color: #10b981; background: linear-gradient(135deg, #f0fdf4 0%, white 100%); box-shadow: 0 10px 25px rgba(16,185,129,0.15); }
.month-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.month-title { font-size: clamp(14px, 4vw, 18px); font-weight: 600; color: #1e293b; border-right: 1px solid #e2e8f0; padding-right: 5px; margin-right: 5px; }
.month-progress { font-size: 12px; color: #64748b; }
.month-stats { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pemasukan { color: #10b981; font-weight: 600; font-size: 14px; }
.kurang { color: #ef4444; font-weight: 600; font-size: 14px; }
.progress-bar { height: 6px; background: #ef4444; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: #10b981; border-radius: 3px; transition: width 0.3s ease; }

/* PIVOT TABLE */
.month-detail-table{background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.1);margin:20px 0;overflow:visible;display:flex;flex-direction:column}
.table-header{background:linear-gradient(135deg,#3b82f6 0,#1e40af 100%);color:#fff;padding:15px;border-radius:12px 12px 0 0;flex-shrink:0}
.table-header h3 { margin: 0; font-size: clamp(14px, 4vw, 18px); font-weight: 600; }
.table-wrapper{overflow-x:auto;overflow-y:auto;max-height:600px;scrollbar-width:thin}
.table-wrapper table { width: 100%; border-collapse: collapse; table-layout: auto; }
.table-wrapper th, .table-wrapper td { padding: 10px 12px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.table-wrapper th:nth-child(1), .table-wrapper td:nth-child(1) { width: 5%; text-align: center; }
.table-wrapper th:nth-child(2), .table-wrapper td:nth-child(2) { width: 20%; }
.table-wrapper th:nth-child(3), .table-wrapper td:nth-child(3) { width: 35%; }
.table-wrapper th:nth-child(4), .table-wrapper td:nth-child(4) { width: 10%; }
.table-wrapper th:nth-child(5), .table-wrapper td:nth-child(5) { width: 12%; }
.table-wrapper th:nth-child(6), .table-wrapper td:nth-child(6) { width: 10%; }
.table-wrapper td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrapper::-webkit-scrollbar{width:6px;height:6px}
.table-wrapper::-webkit-scrollbar-track{background:#f1f5f9;border-radius:4px}
.table-wrapper::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}
.table-wrapper::-webkit-scrollbar-thumb:hover{background:#94a3b8}
.table-wrapper thead th{position:sticky;top:0;z-index:10;background:linear-gradient(135deg,#f8fafc,#f1f5f9)!important;box-shadow:0 2px 4px rgba(0,0,0,.1);font-weight:700!important;color:#1e293b!important;border-bottom:2px solid #e2e8f0!important;font-size:12px}
.table-wrapper table{table-layout:auto;width:100%;border-collapse:collapse}
.table-content{flex:1;background:#fff;border-radius:0 0 12px 12px;box-shadow:0 -2px 10px rgba(0,0,0,.05);margin-top:8px;overflow:hidden;max-height:600px}
.status { padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; white-space: nowrap; }
.status.approved { background: #d1fae5; color: #065f46; }
.status.pending { background: #fef3c7; color: #92400e; }
.status.empty { background: #fee2e2; color: #991b1b; }
.search-container { display: flex; gap: 12px; margin-top: 15px; padding: 15px; border-top: 1px solid #e2e8f0; align-items: center; }
.pivot-search-input { padding: 12px 15px; border: 2px solid #dee2e6; border-radius: 12px; background: white; font-size: 14px; flex: 1; }
.pivot-clear-btn { padding: 12px 15px; background: linear-gradient(135deg, #ef4444, #dc3545); color: white; border: none; border-radius: 12px; font-weight: 600; cursor: pointer; font-size: 14px; width: 20%; }
.page-info-container { text-align: center; padding: 15px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.page-info { font-size: 13px; font-weight: 600; color: #4b5563; padding: 12px 15px; background: white; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: block; width: 100%; }
.pagination-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 15px; background: linear-gradient(135deg, #f8f9fa, #e9ecef); border-radius: 0 0 15px 15px; }
.pivot-prev-btn, .pivot-next-btn { padding: 10px 14px; border: 2px solid #dee2e6; background: white; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 12px; flex: 1; min-width: 70px; }
.pivot-page-select { padding: 10px 12px; border: 2px solid #dee2e6; border-radius: 10px; background: white; font-size: 12px; font-weight: 500; min-width: 60px; }
.pagination-center { display: flex; justify-content: center; }
.section-header { display: flex; align-items: center; background: linear-gradient(135deg, #f8f9fa, #e9ecef); padding: 15px; border-radius: 0 0 15px 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }
.section-header h2 { margin: 0; color: #2c3e50; font-size: clamp(18px, 4vw, 24px); font-weight: 600; }
.section-header span { cursor: pointer; color: #667eea; font-weight: 600; font-size: 13px; padding: 6px 10px; border-radius: 8px; transition: all 0.2s; }
.nav-button { display: inline-flex; align-items: center; gap: 6px; color: #10b981; font-weight: 600; font-size: 13px; padding: 8px 12px; border-radius: 8px; text-decoration: none; transition: all 0.2s; background: rgba(16, 185, 129, 0.1); border: 1px solid #86efac; }
.nav-button:hover { background: #d1fae5; color: #059669; border-color: #6ee7b7; }
.year-selector { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: #f0f9ff; border-radius: 10px; border: 2px solid #bfdbfe; }
.year-selector label { font-weight: 600; color: #1e40af; font-size: 13px; }
.year-selector select { padding: 8px 12px; border: 2px solid #3b82f6; border-radius: 8px; background: white; color: #1e293b; font-weight: 600; font-size: 13px; cursor: pointer; min-width: 100px; }
.year-selector select:hover { border-color: #1e40af; background: #f0f9ff; }
.korlap-selector { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: #f0f9ff; border-radius: 10px; border: 2px solid #bfdbfe; }
.korlap-selector label { font-weight: 600; color: #1e40af; font-size: 13px; }
.korlap-selector select { padding: 8px 12px; border: 2px solid #3b82f6; border-radius: 8px; background: white; color: #1e293b; font-weight: 600; font-size: 13px; cursor: pointer; min-width: 120px; }
.korlap-selector select:hover { border-color: #1e40af; background: #f0f9ff; }
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.95); display: flex; justify-content: center; align-items: center; z-index: 9999; font-size: 18px; }

/* STATISTICS SECTION */
.statistics-section { margin: 30px 0; padding: 20px; background: white; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
.statistics-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.statistics-header h3 { margin: 0; color: #1e293b; font-size: clamp(16px, 4vw, 22px); font-weight: 700; }
.export-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.export-btn { padding: 10px 15px; background: linear-gradient(135deg, #3b82f6, #1e40af); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.export-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.export-btn.excel { background: linear-gradient(135deg, #10b981, #059669); }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.chart-container { background: white; padding: 15px; border-radius: 10px; border: 1px solid #e2e8f0; }
.chart-container h4 { margin: 0 0 15px 0; color: #2c3e50; font-size: 14px; font-weight: 600; }

/* CSS Untuk View Bukti TF */
/* 🔥 MODAL BUKTI TRANSFER */
.bukti-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.bukti-modal.active {
    display: flex !important;
}

.bukti-image {
    max-width: 95%;
    max-height: 95%;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.1s ease;
    transform-origin: center;
    user-select: none;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- HELP MODAL STYLES --- */
.help-button { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #FFD60A 0%, #FFC300 50%, #FF006E 100%); color: white; border: 3px solid white; font-size: 28px; cursor: pointer; box-shadow: 0 8px 20px rgba(255, 211, 0, 0.5), 0 0 30px rgba(255, 0, 110, 0.3); transition: all 0.3s ease; z-index: 999; display: flex; align-items: center; justify-content: center; animation: helpPulse 2s infinite; }
.help-button:hover { transform: scale(1.15); box-shadow: 0 12px 30px rgba(255, 211, 0, 0.7), 0 0 40px rgba(255, 0, 110, 0.5); animation: none; }
.help-button:active { transform: scale(0.92); }
@keyframes helpPulse { 0%, 100% { box-shadow: 0 8px 20px rgba(255, 211, 0, 0.5), 0 0 30px rgba(255, 0, 110, 0.3); } 50% { box-shadow: 0 8px 25px rgba(255, 211, 0, 0.7), 0 0 40px rgba(255, 0, 110, 0.5); } }
.help-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 10000; justify-content: center; align-items: center; animation: fadeIn 0.3s ease; }
.help-modal.active { display: flex; }
.help-content { background: white; border-radius: 16px; max-width: 600px; max-height: 85vh; width: 90%; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); animation: slideUp 0.3s ease; }
.help-header { background: linear-gradient(135deg, #FFD60A 0%, #FFC300 50%, #FF006E 100%); color: white; padding: 24px; border-radius: 16px 16px 0 0; display: flex; justify-content: space-between; align-items: center; }
.help-header h2 { margin: 0; font-size: 22px; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.help-close { background: rgba(255, 255, 255, 0.3); border: none; color: white; font-size: 28px; cursor: pointer; padding: 0; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.help-close:hover { background: rgba(255, 255, 255, 0.5); transform: rotate(90deg); }
.help-body { padding: 24px; color: #1e293b; }
.help-section { margin-bottom: 20px; padding: 12px; background: #f8f9fa; border-left: 4px solid #FFD60A; border-radius: 8px; }
.help-section h3 { font-size: 16px; font-weight: 700; color: #FF006E; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.help-section p { font-size: 14px; line-height: 1.6; color: #64748b; margin: 0; }
.help-usage { background: #e3f2fd; border-left: 4px solid #3b82f6; padding: 12px; border-radius: 6px; margin-top: 10px; font-size: 13px; color: #1e40af; line-height: 1.7; }
.help-usage div { margin: 4px 0; }
.help-tip { background: #fff3cd; border-left: 4px solid #FFD60A; padding: 12px; border-radius: 6px; margin-top: 8px; font-size: 13px; color: #856404; font-weight: 500; }
.help-list { list-style: none; padding-left: 0; margin: 8px 0; }
.help-list li { padding: 6px 0; padding-left: 24px; position: relative; font-size: 14px; color: #64748b; line-height: 1.5; }
.help-list li:before { content: "✓"; position: absolute; left: 0; color: #FF006E; font-weight: 700; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 768px) {
    .help-button { bottom: 16px; right: 16px; width: 56px; height: 56px; font-size: 26px; }
    .help-content { max-height: 90vh; width: 95%; }
    .help-header { padding: 18px; }
    .help-header h2 { font-size: 18px; }
    .help-body { padding: 16px; }
}

.view-bukti-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    margin-left: 6px;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
    flex-shrink: 0;
}

.view-bukti-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* ========================================
   RESPONSIVE MOBILE-FIRST BREAKPOINTS
======================================= */

/* TABLET (768px and down) */
@media (max-width: 768px) {
    body { padding: 6px; }
    .container { border-radius: 12px; }
    .header { padding: 20px 15px; }
    .header h1 { font-size: 22px; }
    .header p { font-size: 12px; }

    [style*="padding: 30px"] {
        padding: 15px !important;
    }

    .dashboard-summary {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
        padding: 10px;
    }

    .stat-card {
        padding: 10px;
        font-size: 12px;
    }

    .stat-card div:first-child {
        font-size: 14px;
        font-weight: 700;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }

    .month-card {
        padding: 12px;
    }

    .month-title {
        font-size: 14px;
    }

    .month-progress {
        font-size: 11px;
    }

    .month-stats {
        font-size: 12px;
    }

    .pemasukan, .kurang {
        font-size: 12px;
    }

    .month-detail-table {
        margin: 15px 0;
    }

    .table-header {
        padding: 12px;
    }

    .table-header h3 {
        font-size: 14px;
    }

    .table-wrapper {
        max-height: 50vh;
    }

    .table-wrapper th, .table-wrapper td {
        padding: 8px 8px;
        font-size: 11px;
    }

    .table-wrapper thead th {
        font-size: 10px;
    }

    .status {
        font-size: 10px;
        padding: 4px 8px;
    }

    .search-container {
        padding: 10px;
        gap: 10px;
    }

    .pivot-search-input, .pivot-clear-btn {
        font-size: 13px;
        padding: 10px 12px;
    }

    .page-info {
        font-size: 12px;
        padding: 8px 12px;
    }

    .pagination-container {
        padding: 10px;
        gap: 6px;
    }

    .pivot-prev-btn, .pivot-next-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 60px;
    }

    .pivot-page-select {
        font-size: 11px;
        padding: 8px 10px;
        min-width: 50px;
    }


    
    .section-header h2 {
        font-size: 18px;
        flex: 1;
        flex-basis: 100%;  /* MAKSA BARIS BARU */
        margin: 6px 0 0 0; /* Jarak atas */
        order: 1;          /* Urutan: h2 duluan */
    }
    
    .section-header span {
        font-size: 12px;
        padding: 4px 8px;
        order: 0;  /* Tombol kiri */
    }
    
    .nav-button {
        font-size: 12px;
        padding: 6px 10px;
        order: 0;  /* Tombol kiri */
    }

    /* Year & Korlap SIDE-BY-SIDE baris kedua */
    .year-selector, .korlap-selector {
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        width: auto !important;
        padding: 8px 12px !important;
        min-width: 140px;
        order: 2;  /* Baris kedua */
        flex: 1;   /* Bagi rata */
    }
    
    .year-selector label, .korlap-selector label { 
        font-size: 12px; 
        white-space: nowrap; 
    }
    
    .year-selector select, .korlap-selector select { 
        min-width: 80px; 
        font-size: 12px; 
        padding: 6px 8px; 
    }

    /* Modal bukti */
    .bukti-modal .bukti-image {
        max-width: 98%;
        max-height: 85%;
    }

    .modal-close {
        top: 12px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}