/* ============================================================
   Portal Reseller - Stylesheet Terpusat
   Warna primer/sekunder di-inject dari pengaturan admin
   melalui CSS variable --rs-primary / --rs-secondary
   ============================================================ */

:root {
    --rs-primary: #01bbee;
    --rs-secondary: #35cef8;
    --rs-success: #2ecc71;
    --rs-danger: #e74c3c;
    --rs-warning: #f39c12;
    --rs-dark: #16202c;
    --rs-bg: #f4f6f9;
    --rs-text: #333333;
    --rs-muted: #7e8ca0;
    --rs-card-radius: 16px;
    --rs-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --rs-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
    --rs-transition: all 0.25s ease;
}

/* ============ Dasar ============ */
body {
    background: var(--rs-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--rs-text);
    min-height: 100vh;
}

a { text-decoration: none; }

.rs-gradient-bg {
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
}

.rs-text-primary { color: var(--rs-primary) !important; }
.rs-text-success { color: var(--rs-success) !important; }
.rs-text-danger  { color: var(--rs-danger) !important; }

/* ============ Sidebar ============ */
.rs-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    background:
        linear-gradient(180deg, rgba(10, 16, 26, 0.82), rgba(10, 16, 26, 0.94)),
        linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    background-size: auto, 100% 100%;
    color: #fff;
    z-index: 1040;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.rs-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rs-sidebar .brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 4px;
}

.rs-sidebar .brand .brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.rs-sidebar .brand .brand-sub {
    font-size: 0.72rem;
    opacity: 0.65;
    letter-spacing: 0.5px;
}

.rs-sidebar .nav-scroll { overflow-y: auto; flex-grow: 1; padding: 14px 12px; }

.rs-sidebar .nav-caption {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.45);
    padding: 14px 12px 6px;
}

.rs-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.78);
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 3px;
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--rs-transition);
    position: relative;
}

.rs-sidebar .nav-link i { width: 20px; text-align: center; font-size: 1.05rem; }

.rs-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.rs-sidebar .nav-link.active {
    color: #fff;
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.rs-sidebar .sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    opacity: 0.6;
}

/* ============ Area utama ============ */
.rs-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.rs-topbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.rs-topbar .page-heading { font-weight: 700; font-size: 1.05rem; }

.rs-balance-badge {
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    color: #fff;
    font-weight: 700;
    border-radius: 50px;
    padding: 9px 20px;
    font-size: 0.92rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.rs-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.burger-btn {
    background: none;
    border: none;
    font-size: 1.35rem;
    color: var(--rs-text);
    display: none;
}

.rs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

.rs-content { padding: 26px 24px; flex-grow: 1; }

.rs-footer {
    background: #fff;
    border-top: 1px solid #eef2f7;
    padding: 14px 24px;
    font-size: 0.8rem;
    color: var(--rs-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============ Kartu ============ */
.rs-card {
    background: #fff;
    border-radius: var(--rs-card-radius);
    box-shadow: var(--rs-shadow);
    border: 1px solid #eef2f7;
}

.rs-card-pad { padding: 24px; }

.rs-page-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.rs-page-title .title-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.rs-page-title h4 { font-weight: 700; margin: 0; }
.rs-page-title p { margin: 0; color: var(--rs-muted); font-size: 0.85rem; }

/* ============ Kartu statistik ============ */
.rs-stat-card {
    background: #fff;
    border-radius: var(--rs-card-radius);
    box-shadow: var(--rs-shadow);
    border: 1px solid #eef2f7;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    transition: var(--rs-transition);
}

.rs-stat-card:hover { transform: translateY(-3px); box-shadow: var(--rs-shadow-lg); }

.rs-stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.rs-stat-icon.primary { background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary)); }
.rs-stat-icon.success { background-image: linear-gradient(135deg, #2ecc71, #27ae60); }
.rs-stat-icon.danger  { background-image: linear-gradient(135deg, #e74c3c, #c0392b); }
.rs-stat-icon.warning { background-image: linear-gradient(135deg, #f39c12, #e67e22); }
.rs-stat-icon.dark    { background-image: linear-gradient(135deg, #34495e, #2c3e50); }

.rs-stat-card .stat-value { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.rs-stat-card .stat-label { font-size: 0.78rem; color: var(--rs-muted); }

/* ============ Kartu aksi cepat ============ */
.rs-action-card {
    background: #fff;
    border-radius: var(--rs-card-radius);
    box-shadow: var(--rs-shadow);
    border: 1px solid #eef2f7;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    transition: var(--rs-transition);
    color: var(--rs-text);
}

.rs-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--rs-shadow-lg);
    color: var(--rs-text);
}

.rs-action-card .action-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

/* ============ Tombol ============ */
.btn-rs-primary {
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    padding: 10px 22px;
    transition: var(--rs-transition);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.btn-rs-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    filter: brightness(1.05);
}

.btn-rs-outline {
    background: transparent;
    color: var(--rs-primary);
    border: 2px solid var(--rs-primary);
    border-radius: 50px;
    font-weight: 600;
    padding: 9px 22px;
    transition: var(--rs-transition);
}

.btn-rs-outline:hover {
    background: var(--rs-primary);
    color: #fff;
}

.btn-rs-dark {
    background: var(--rs-dark);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    padding: 10px 22px;
    transition: var(--rs-transition);
}

.btn-rs-dark:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.2); }

.btn-rs-success {
    background-image: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    padding: 10px 22px;
    transition: var(--rs-transition);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.btn-rs-success:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.05); }

/* ============ Kartu paket ============ */
.rs-package-card {
    background: #fff;
    border-radius: var(--rs-card-radius);
    box-shadow: var(--rs-shadow);
    border: 2px solid transparent;
    overflow: hidden;
    height: 100%;
    cursor: pointer;
    transition: var(--rs-transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.rs-package-card:hover { transform: translateY(-4px); box-shadow: var(--rs-shadow-lg); }

.rs-package-card.selected {
    border-color: var(--rs-primary);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

.rs-package-card .pkg-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--rs-primary);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 2;
}

.rs-package-card.selected .pkg-check { display: flex; }

.rs-package-header {
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    color: #fff;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.rs-package-header::before {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    top: -55px;
    right: -30px;
}

.rs-package-header .pkg-name { font-weight: 700; font-size: 1.05rem; position: relative; z-index: 1; }

.rs-popular-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #ff6b95;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 0 0 12px 0;
    letter-spacing: 0.5px;
    z-index: 2;
}

.rs-package-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }

.rs-package-body .modal-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--rs-primary);
    line-height: 1.2;
}

/* ============ Struk digital ============ */
.rs-receipt {
    background: #fff;
    border-radius: var(--rs-card-radius);
    box-shadow: var(--rs-shadow);
    border: 1px dashed #c9d4e0;
    padding: 28px 24px;
    text-align: center;
    position: relative;
}

.rs-receipt::before, .rs-receipt::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--rs-bg);
    top: 50%;
    transform: translateY(-50%);
}

.rs-receipt::before { left: -12px; }
.rs-receipt::after { right: -12px; }

.rs-receipt .rs-code {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--rs-primary);
    line-height: 1.3;
    word-break: break-all;
}

.rs-receipt .receipt-divider {
    border-top: 2px dashed #dfe6ee;
    margin: 18px 0;
}

/* ============ Tabel ============ */
.rs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.rs-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--rs-muted);
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfd;
}

.rs-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid #f2f5f9;
    font-size: 0.9rem;
    vertical-align: middle;
}

.rs-table tbody tr:hover td { background: #f8fbfe; }

/* ============ Badge ============ */
.badge-rs {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-rs-primary { background: rgba(1, 187, 238, 0.12); color: var(--rs-primary); }
.badge-rs-success { background: rgba(46, 204, 113, 0.12); color: #27ae60; }
.badge-rs-danger  { background: rgba(231, 76, 60, 0.12); color: var(--rs-danger); }
.badge-rs-warning { background: rgba(243, 156, 18, 0.14); color: #b9770e; }
.badge-rs-dark    { background: rgba(52, 73, 94, 0.12); color: #34495e; }

/* ============ Form ============ */
.form-control, .form-select {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px 15px;
    font-size: 0.92rem;
    transition: var(--rs-transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--rs-primary);
    box-shadow: 0 0 0 3px rgba(1, 187, 238, 0.15);
}

.form-label { font-weight: 600; font-size: 0.88rem; }
.form-text { font-size: 0.76rem; }

/* ============ Alert kustom ============ */
.rs-content .alert {
    border-radius: 14px;
    border: none;
    border-left: 5px solid;
    padding: 14px 18px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    animation: rsSlideDown 0.35s ease;
}
.rs-content .alert-success { background: #eafaf1; border-color: #2ecc71; color: #1d7a45; }
.rs-content .alert-danger  { background: #fdecea; border-color: #e74c3c; color: #a93226; }
.rs-content .alert-warning { background: #fef9e7; border-color: #f39c12; color: #8a6113; }
.rs-content .alert-info    { background: #e8f7fd; border-color: var(--rs-primary); color: #0e6b85; }

.rs-alert {
    border-radius: 14px;
    border: none;
    border-left: 5px solid;
    padding: 14px 18px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    animation: rsSlideDown 0.35s ease;
}

.rs-alert-success { background: #eafaf1; border-color: #2ecc71; color: #1d7a45; }
.rs-alert-danger  { background: #fdecea; border-color: #e74c3c; color: #a93226; }
.rs-alert-warning { background: #fef9e7; border-color: #f39c12; color: #8a6113; }
.rs-alert-info    { background: #e8f7fd; border-color: var(--rs-primary); color: #0e6b85; }

@keyframes rsSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ Login / Register ============ */
.rs-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(10, 16, 26, 0.8), rgba(10, 16, 26, 0.92)),
        linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    background-size: auto, 100% 100%;
}

.rs-auth-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.rs-auth-head {
    background-image: linear-gradient(135deg, var(--rs-primary), var(--rs-secondary));
    color: #fff;
    padding: 30px 28px;
    text-align: center;
}

.rs-auth-head img {
    width: 74px;
    height: 74px;
    object-fit: contain;
    background: #fff;
    border-radius: 18px;
    padding: 8px;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.rs-auth-head h4 { font-weight: 700; margin: 0; font-size: 1.25rem; }
.rs-auth-head p { margin: 4px 0 0; font-size: 0.82rem; opacity: 0.85; }

.rs-auth-content { padding: 28px; }

/* ============ QR card ============ */
.rs-qr-img {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    max-width: 260px;
    width: 100%;
    padding: 8px;
    background: #fff;
}

/* ============ Responsif ============ */
@media (max-width: 991px) {
    .rs-sidebar { transform: translateX(-100%); }
    .rs-sidebar.open { transform: translateX(0); }
    .rs-overlay.show { display: block; }
    .rs-main { margin-left: 0; }
    .burger-btn { display: inline-block; }
    .rs-content { padding: 18px 14px; }
    .rs-receipt .rs-code { font-size: 1.6rem; }
}
