/* ================== TAB AGEN - ELEGANT DESIGN ================== */
#agen-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 85%;           /* sama seperti user panel */
    height: 100%;
    background-color: #ffffff;
    overflow-y: auto;
    padding: 0.75rem 0.5rem 0.75rem 0.75rem;
    transform: translateX(-100%);     /* mulai dari kiri (sama seperti user) */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);   /* timing sama */
    z-index: 1060;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    display: none;   /* default hidden */
}

#agen-dashboard.active {
    transform: translateX(0);
    display: block;
}

/* Optional: biar lebih smooth saat scroll */
#agen-dashboard.active {
    overflow-y: auto !important;
}

/* Pastikan body bisa scroll lagi saat panel terbuka */
.user-panel.active {
    overflow-y: auto !important;
}

#agen-tabs {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 8px 12px;
    margin-bottom: 0;
}

.agen-tab-btn {
    position: relative;
    padding: 1rem 0.25rem;
    margin: 0.5rem 0.25rem;
    font-weight: 600;
    color: #6c757d;
    background: transparent;
    border: none;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.agen-tab-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.agen-tab-btn:hover:not(.active) {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.08);
}

.agen-tab-btn.active {
    color: #e67e22;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.12);
    font-weight: 600;
}

/* Indikator Elegan */
.agen-tab-btn:after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #e67e22, #f39c12);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.agen-tab-btn.active:after {
    width: 35%;
    opacity: 1;
}

/* Tab Content */
.agen-tab-pane {
    padding: 24px 20px;
    min-height: 320px;
    background: #ffffff;
}

/* Optional: Tambahan sentuhan elegan */
#agen-tabs .agen-tab-btn:first-child {
    margin-right: 8px;
}

/* HEADER KODE HEMAT */
.kode-header {
    padding: 0 8px;
    margin: -2rem -1.5rem 1rem;
    border-bottom: 1px solid #f1f3f5;
}

.kode-title {
    font-size: 0.9rem;
    color: #2c3e50;
}

/* KODE HEMAT - CARD ELEGANT */
.agen-kode-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    margin: 12px -1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agen-kode-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.12);
    border-color: #f39c12;
}

.kode-hemat-text {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 4px;
    color: #2c3e50;
    margin: 0;
}

.btn-custom-aktif {
    background-color: #ff9800;
    /* Mengubah warna latar belakang */
    color: white;
    /* Mengubah warna teks */
    border-radius: 8px;
    /* Membuat sudut lebih melengkung */
    border: none;
    /* Menghilangkan border bawaan */
    padding: 10px 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Menambahkan efek bayangan */
    transition: all 0.3s ease;
    /* Efek animasi saat di-hover */
}

/* Efek saat tombol diarahkan oleh mouse */
.btn-custom-aktif:hover {
    background-color: #e68a00;
}

.status-badge {
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #fff3cd;
    color: #856404;
}

/* Empty State Elegan */
.agen-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.agen-empty-state i {
    font-size: 3.5rem;
    opacity: 0.15;
    margin-bottom: 16px;
}

/* ================== TOP AGEN - DESAIN PREMIUM ================== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -1rem -1rem 0;
    padding: 0 8px;
}

.top-header-left {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.top-header-left i {
    color: #22c55e;
    margin-right: 6px;
}

.top-header-right {
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.6rem;
    font-weight: 500;
    color: #1e293b;
}

.top-list {
    background: #fafdff;
    border-radius: 0.25rem;
    border: 1px solid #eef3f9;
    overflow: hidden;
    margin: 1rem -1rem;
}

.top-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 10px solid #edf2f8;
    gap: 0.5rem;
    transition: 0.2s;
}

.top-item:last-child {
    border-bottom: 0;
}

.top-item.self {
    background: #f0f6ff;
    border-left: 5px solid #2563eb;
}

.rank-nomor {
    font-weight: 700;
    font-size: 1.2rem;
    color: #475569;
}

.top-item.self .rank-nomor {
    color: #2563eb;
}

.top-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* WAJIB: Agar flex child bisa menyusut di bawah ukuran konten aslinya */
    flex: 1;
    /* Mengambil sisa ruang yang ada di antara Rank dan Omzet */
}

.top-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.9rem;
    display: block;
    /* Diubah ke block agar overflow bekerja dengan sempurna pada teks tunggal */

    /* Kombinasi maut untuk membuat "..." */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-meta {
    font-size: 0.65rem;
    color: #64748b;
    display: flex;
    gap: 0.5rem;
    margin-top: 6px;
    white-space: nowrap;
}

.top-meta i {
    width: 0.65rem;
}

.top-poin {
    font-weight: 600;
    background: #00ff80;
    padding: 0.5rem;
    border-radius: 15px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.top-item.self .top-poin {
    background: #00ff80;
    color: #1e40af;
}

.top-item.self .top-name {
    color: #1e40af;
}

.top-item.self {
    background: linear-gradient(90deg, #f0f6ff, #dbeafe) !important;
    border: 1px solid #2563eb !important;
    border-radius: 15px;
    border-left: 6px solid #2563eb !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25) !important;
    position: relative;
}