:root {
    /* Elegant Fintech Theme */
    --primary-color: #059669; /* Emerald Green */
    --primary-hover: #047857;
    --primary-light: #d1fae5;
    --bg-body: #f1f5f9; /* Cool Gray */
    --bg-card: #ffffff; /* Pure White */
    --bg-sidebar: #ffffff;

    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --text-label: #94a3b8; /* Slate 400 */

    --border-color: #e2e8f0;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.03);

    --radius: 16px;
    --radius-lg: 24px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }

body { background-color: var(--bg-body); color: var(--text-main); display: flex; min-height: 100vh; overflow-x: hidden; }

/* --- Utility Classes --- */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.text-primary { color: var(--primary-color); }
.text-danger { color: #ef4444; }
.text-success { color: var(--primary-color); }
.w-full { width: 100%; }

/* --- Buttons & Inputs --- */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3); }
.btn-danger { background-color: #ef4444; color: white; }
.btn-danger:hover { background-color: #dc2626; }
.btn-success { background-color: #10b981; color: white; }
.btn-success:hover { background-color: #059669; }
.btn-warning { background-color: #f59e0b; color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 6px; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; border-radius: 4px; }

input, select, textarea {
    width: 100%;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    margin-bottom: 20px;
    outline: none;
    font-size: 1rem;
    transition: var(--transition);
    line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}
input[readonly] {
    background-color: #f8fafc;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Robust File Input Styling */
input[type="file"] {
    border: 2px dashed var(--border-color);
    background-color: #f8fafc;
    color: var(--text-muted);
    padding: 20px;
    border-radius: 16px;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
}
input[type="file"]:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}
/* Add a class to indicate selected state */
.file-selected {
    border-color: var(--primary-color);
    background-color: #f0fdf4;
    color: var(--primary-dark);
}

label { display: block; margin-bottom: 8px; color: var(--text-main); font-weight: 600; font-size: 0.9rem; }

/* --- Layout Structures --- */
#auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}
.auth-box {
    background-color: var(--bg-card);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-card);
    border: 1px solid white;
}

#dashboard-container { display: flex; width: 100%; position: relative; }

/* --- Sidebar --- */
.sidebar { width: 280px; background: white; height: 100vh; position: fixed; left: 0; top: 0; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; z-index: 1000; transition: transform 0.3s; box-shadow: 5px 0 25px rgba(0,0,0,0.03); }
.logo-area { padding: 30px 24px; display: flex; align-items: center; gap: 12px; color: var(--text-main); font-size: 1.4rem; font-weight: 800; }
.nav-links { flex: 1; padding: 20px 10px; overflow-y: auto; }
.nav-item { padding: 14px 18px; display: flex; align-items: center; gap: 14px; color: var(--text-muted); text-decoration: none; cursor: pointer; border-radius: 10px; font-weight: 500; margin-bottom: 6px; transition: var(--transition); }
.nav-item:hover { background-color: var(--bg-body); color: var(--text-main); }
.nav-item.active { background-color: var(--primary-light); color: var(--primary-color); font-weight: 700; }
.user-mini-profile { padding: 24px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; background: #fcfcfc; margin-top: auto; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--border-color); object-fit: cover; border: 2px solid white; box-shadow: var(--shadow-sm); }

/* --- Main Content --- */
.main-content { margin-left: 280px; flex: 1; padding: 40px 30px; width: calc(100% - 280px); transition: margin-left 0.3s; }
.header-title { font-size: 2rem; font-weight: 800; color: var(--text-main); margin-bottom: 30px; letter-spacing: -0.02em; }

/* --- Cards --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; margin-bottom: 30px; }
.stat-card { background: white; padding: 28px; border-radius: 20px; border: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); transition: var(--transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-info h3 { font-size: 2.2rem; color: var(--text-main); font-weight: 800; letter-spacing: -0.03em; }
.stat-info p { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.stat-icon { font-size: 3rem; color: var(--primary-color); opacity: 0.1; }

/* --- Tables (DESKTOP) --- */
.table-container { background: white; border-radius: 20px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 18px 24px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: #fcfcfc; color: var(--text-muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #fcfcfc; }

/* --- Status Badges --- */
.badge { padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.025em; display: inline-block; white-space: nowrap;}
.badge-pending { background: #fef3c7; color: #d97706; }
.badge-active, .badge-approved, .badge-success { background: #d1fae5; color: #059669; }
.badge-rejected, .badge-inactive { background: #fee2e2; color: #dc2626; }

/* --- Toast --- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 3000; pointer-events: none; }
.toast { background: white; color: var(--text-main); padding: 16px 24px; border-radius: 12px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border-left: 4px solid var(--primary-color); display: flex; align-items: center; gap: 12px; animation: slideIn 0.3s ease-out forwards; pointer-events: all; margin-bottom: 10px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Mobile Toggle --- */
.mobile-header { display: none; position: fixed; top: 0; left: 0; right: 0; height: 70px; background: white; z-index: 999; box-shadow: 0 2px 10px rgba(0,0,0,0.05); align-items: center; justify-content: space-between; padding: 0 20px; }
.mobile-toggle { background: transparent; border: none; font-size: 1.5rem; color: var(--text-main); cursor: pointer; }
#sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); backdrop-filter: blur(3px); z-index: 998; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#sidebar-overlay.active { opacity: 1; pointer-events: auto; }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* Layout Adjustments */
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 80px 20px 30px 20px; }
    .mobile-header { display: flex; }
    .logo-area { padding: 20px 15px; }

    /* Typography */
    h2 { font-size: 1.5rem; }
    .header-title { font-size: 1.5rem; margin-top: 20px; }

    /* Stats Grid */
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 20px; }

    /* Flex Directions */
    .flex { flex-direction: column; }
    .gap-4 { gap: 0.75rem; }

    /* Inputs & Buttons */
    .btn { width: 100%; padding: 14px; }
    .btn-sm { width: auto; padding: 8px 14px; }
    .auth-box { margin: 20px; padding: 2rem; border-radius: 16px; }

    /* --- ELEGANT MOBILE TABLE TRANSFORMATION --- */
    .table-container { overflow-x: visible; } /* Remove horizontal scroll */
    .desktop-only { display: none; }

    /* Transform Table Rows to Cards */
    tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        padding: 0;
        background: #ffffff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.03);
        overflow: hidden; /* Contains border logic */
    }

    /* Transform Table Cells */
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f1f5f9;
        padding: 18px 16px; /* Generous padding */
        text-align: right;
        font-size: 1rem; /* Readable size */
        color: var(--text-main);
        width: 100%;
        line-height: 1.5; /* Readable line-height */
        word-break: break-all; /* Break long words */
        overflow-wrap: anywhere;
    }

    /* Last child (Action) remove bottom border for card look */
    td:last-child {
        background: transparent;
        justify-content: flex-end;
        border-bottom: none;
        padding-top: 10px;
        margin-top: 5px;
        border-top: 1px solid var(--border-color);
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Dynamic Labels using data-label attribute */
    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-label);
        font-size: 0.85rem;
        text-align: left;
        margin-right: 12px;
        flex: 0 0 auto; /* Prevent label from stretching */
        min-width: 120px; /* Ensure alignment */
        text-transform: uppercase;
    }
}
.logo-img{
    height: 36px;
    width: auto;
    object-fit: contain;
}
.btn-white{
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.btn-white:hover{
    background: #f9fafb;
    color: #111827;
}
/* Tambahkan di style.css */
.pay-card.active {
    border-color: var(--primary-color) !important;
    background: var(--primary-light) !important;
}

.pay-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
/* Tambahkan CSS ini ke file style.css Anda yang sudah ada */

/* Payment Card Active State */
.pay-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.pay-card.active {
    border-color: var(--primary-color) !important;
    background: var(--primary-light) !important;
}

.pay-card:hover {
    border-color: #cbd5e1 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Input Group Spacing */
.input-group {
    margin-bottom: 20px;
}

/* Modern Input Class */
.modern-input {
    width: 100%;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    outline: none;
    font-size: 1rem;
    transition: var(--transition);
    line-height: 1.5;
}

.modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Margin Top Classes */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

/* Padding Classes */
.p-4 { padding: 1rem; }

/* Desktop Only Class for Mobile */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Ensure file inputs show properly */
input[type="file"]::-webkit-file-upload-button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--primary-hover);
}

/* Better form labels */
label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Status Badge improvements */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-block;
    white-space: nowrap;
}

.badge-pending {
    background: #fef3c7;
    color: #d97706;
}

.badge-active,
.badge-approved,
.badge-success,
.badge-verified {
    background: #d1fae5;
    color: #059669;
}

.badge-rejected,
.badge-inactive,
.badge-unverified {
    background: #fee2e2;
    color: #dc2626;
}

/* Table improvements for mobile */
@media (max-width: 768px) {
    table {
        min-width: 100% !important;
    }
    
    thead {
        display: none;
    }
    
    tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        overflow: hidden;
        background: white;
    }
    
    tbody td {
        display: flex;
        justify-content: space-between;
        padding: 12px 16px;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }
    
    tbody td:last-child {
        border-bottom: none;
        border-top: 1px solid var(--border-color);
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-label);
        font-size: 0.85rem;
        text-align: left;
        min-width: 120px;
        text-transform: uppercase;
    }
}

/* Button improvements */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-white {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

.btn-white:hover {
    background: #f9fafb;
    color: #111827;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Responsive button on mobile */
@media (max-width: 768px) {
    .btn:not(.btn-sm):not(.btn-xs) {
        width: 100%;
        padding: 14px;
    }
    
    .btn-sm,
    .btn-xs {
        width: auto;
    }
}