:root {
    --ink: #101828;
    --muted: #667085;
    --line: #e4e7ec;
    --blue: #155eef;
    --cyan: #06aed4;
    --dark: #07111f;
    --panel: #ffffff;
    --bg: #f4f7fb;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--dark);
    color: #fff;
    padding: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
}

.sidebar-backdrop {
    display: none;
}

.brand, .login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #fff;
    font-weight: 800;
}

.brand span, .topbar p, .userbox span, .login-brand p, .login-note {
    color: var(--muted);
    margin: 0;
}

.sidebar .brand span {
    color: #9fb0c7;
    display: block;
    font-size: 13px;
}

.sidebar .nav-link {
    color: #c9d6e8;
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.main {
    padding: 24px;
}

.topbar {
    background: linear-gradient(135deg, #07111f, #123a66);
    color: #fff;
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    display: none;
    place-items: center;
    flex: 0 0 auto;
}

.menu-toggle i {
    font-size: 26px;
    line-height: 1;
}

.topbar h1 {
    font-size: 26px;
    margin: 0 0 4px;
}

.topbar p, .userbox span {
    color: #b8c9df;
}

.userbox {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card, .panel, .login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(16, 24, 40, .06);
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    color: var(--muted);
    font-size: 14px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.stat-card[class*="stat-card--"] {
    border: 0;
    color: #fff;
    overflow: hidden;
    position: relative;
    box-shadow: 0 16px 34px rgba(16, 24, 40, .12);
}

.stat-card[class*="stat-card--"]::after {
    content: "";
    position: absolute;
    width: 96px;
    height: 96px;
    right: -32px;
    top: -34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
}

.stat-card[class*="stat-card--"] span,
.stat-card[class*="stat-card--"] strong {
    color: inherit;
    position: relative;
    z-index: 1;
}

.stat-card[class*="stat-card--"] span {
    display: block;
    min-height: 40px;
    color: rgba(255, 255, 255, .82);
    font-weight: 700;
    line-height: 1.35;
}

.stat-card[class*="stat-card--"] strong {
    line-height: 1.1;
}

.stat-card--revenue {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.stat-card--customer {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
}

.stat-card--safe {
    background: linear-gradient(135deg, #15803d, #84cc16);
}

.stat-card--warning {
    background: linear-gradient(135deg, #b45309, #f59e0b);
}

.stat-card--partner {
    background: linear-gradient(135deg, #7c3aed, #c084fc);
}

.stat-card--income {
    background: linear-gradient(135deg, #be123c, #fb7185);
}

.stat-card--active {
    background: linear-gradient(135deg, #047857, #22c55e);
}

.stat-card--vpn {
    background: linear-gradient(135deg, #0369a1, #06b6d4);
}

.stat-card--pppoe {
    background: linear-gradient(135deg, #4338ca, #818cf8);
}

.stat-card--approval {
    background: linear-gradient(135deg, #c2410c, #fb923c);
}

.stat-card--reward {
    background: linear-gradient(135deg, #a16207, #eab308);
}

.stat-card--dashboard {
    background: linear-gradient(135deg, #334155, #64748b);
}

.panel {
    padding: 20px;
    margin-top: 18px;
}

.table {
    vertical-align: middle;
}

.badge-soft {
    border-radius: 999px;
    padding: 6px 10px;
    background: #e9f8fb;
    color: #087990;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(7, 17, 31, .92), rgba(21, 94, 239, .78)),
        url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-card {
    width: min(460px, 100%);
    padding: 28px;
}

.login-brand h1 {
    font-size: 24px;
    margin: 0;
}

.invoice-paper {
    background: #fff;
    color: #101828;
}

.invoice-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 2px solid var(--line);
    padding-bottom: 18px;
}

.invoice-head h2 {
    margin: 0 0 4px;
    font-size: 28px;
}

.invoice-head p, .invoice-head span {
    color: var(--muted);
    margin: 0;
}

.invoice-head strong {
    display: block;
    font-size: 24px;
}

.invoice-section-title {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.payment-qris {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.payment-qris img {
    display: block;
    width: 100%;
    height: auto;
}

.payment-info {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    height: 100%;
}

.payment-upload {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.payment-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.payment-list {
    display: grid;
    gap: 10px;
}

.payment-list div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.payment-list span {
    color: var(--ink);
}

.vpn-link-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vpn-link-cell a:first-child {
    max-width: 260px;
    overflow-wrap: anywhere;
}

.modal-dialog-scrollable form.modal-content {
    max-height: 100%;
}

.modal-dialog-scrollable form.modal-content .modal-body {
    overflow-y: auto;
}

.modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(86vw, 310px);
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 24px 0 60px rgba(7, 17, 31, .22);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(7, 17, 31, .48);
        z-index: 1030;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .menu-toggle {
        display: grid;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main {
        min-width: 0;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        border-radius: 0 0 8px 8px;
        margin: -24px -24px 22px;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 12px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        margin: -12px -12px 18px;
        padding: 14px;
    }

    .topbar-title {
        width: 100%;
        align-items: flex-start;
    }

    .topbar h1 {
        font-size: 20px;
        line-height: 1.2;
    }

    .stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card strong {
        font-size: 24px;
    }

    .panel {
        padding: 14px;
        margin-top: 14px;
    }

    .userbox {
        width: 100%;
        justify-content: space-between;
    }

    .table-responsive {
        margin-inline: -4px;
    }

    .payment-list div {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .no-print,
    .alert {
        display: none !important;
    }

    .app-shell,
    .main {
        display: block;
        padding: 0;
        min-height: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }

    .invoice-paper {
        padding: 0;
    }
}
