:root {
    --pr-primary: #F74D4D;
    --pr-primary-hover: #e23c3c;
    --pr-primary-soft: #fee2e2;
    --pr-dark: #161c2d;
    --pr-dark-2: #1f2942;
    --pr-success: #10b981;
    --pr-info: #3b82f6;
    --pr-warn: #f59e0b;
    --pr-text: #4b5563;
    --pr-heading: #111827;
    --pr-border: #eef0f4;
    --pr-bg: #f7f8fb;
}

* { box-sizing: border-box; }
body {
    font-family: "Figtree", "Inter", sans-serif;
    color: var(--pr-text);
    margin: 0;
    background: var(--pr-bg);
}
h1,h2,h3,h4,h5,h6 { color: var(--pr-heading); margin: 0; }
a { text-decoration: none; color: inherit; }

/* Auth shell (login / otp / wizard) */
.auth-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #161c2d 0%, #1f2942 50%, #2a1a3a 100%);
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 30%, rgba(247,77,77,0.20), transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(139,92,246,0.18), transparent 40%);
    pointer-events: none;
}
.auth-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    overflow: hidden;
    max-width: 880px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    z-index: 1;
}
.auth-side {
    background: linear-gradient(160deg, #F74D4D 0%, #c026d3 100%);
    color: #fff;
    padding: 3rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.auth-side::before {
    content:"";
    position: absolute;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    top: -100px; right: -100px;
}
.auth-side::after {
    content:"";
    position: absolute;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    bottom: -60px; left: -60px;
}
.auth-side img.brand-logo {
    width: 86px; height: 86px;
    object-fit: contain;
    margin-bottom: 1rem;
    position: relative; z-index: 1;
}
.auth-side h2 { color: #fff; font-weight: 800; font-size: 1.5rem; margin-bottom: 0.35rem; position: relative; z-index: 1;}
.auth-side p { color: rgba(255,255,255,0.9); font-size: 0.95rem; margin: 0; position: relative; z-index: 1;}

.auth-body {
    padding: 3rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-body .mobile-logo {
    display: none;
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
}
.auth-body h3 {
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    color: var(--pr-heading);
}
.auth-body .lead {
    color: var(--pr-text);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}
.form-label-pr {
    font-size: 0.85rem;
    color: var(--pr-heading);
    font-weight: 600;
    margin-bottom: 0.35rem;
    display: block;
}
.form-control-pr {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    color: var(--pr-heading);
    transition: all 0.2s ease;
    outline: none;
}
.form-control-pr:focus {
    border-color: var(--pr-primary);
    box-shadow: 0 0 0 3px rgba(247,77,77,0.15);
}
.form-control-pr::placeholder { color: #9ca3af; }

.input-phone-wrap {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}
.input-phone-wrap:focus-within {
    border-color: var(--pr-primary);
    box-shadow: 0 0 0 3px rgba(247,77,77,0.15);
}
.input-phone-prefix {
    background: #f9fafb;
    color: var(--pr-heading);
    padding: 0.85rem 0.95rem;
    font-weight: 600;
    border-right: 1px solid #e5e7eb;
    font-size: 1rem;
    display: flex;
    align-items: center;
}
.input-phone-wrap input {
    flex: 1;
    border: 0;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.btn-pr-primary {
    background: var(--pr-primary);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 0.9rem 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-pr-primary:hover {
    background: var(--pr-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(247,77,77,0.25);
}
.btn-pr-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}
.auth-footer a { color: var(--pr-primary); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.auth-links a, .auth-links button {
    color: var(--pr-primary);
    font-weight: 600;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.auth-links a:hover, .auth-links button:hover { text-decoration: underline; }

/* OTP 6-digit input */
.otp-row {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.otp-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 48px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: all 0.15s ease;
    background: #fff;
    color: var(--pr-heading);
}
.otp-box:focus {
    border-color: var(--pr-primary);
    box-shadow: 0 0 0 3px rgba(247,77,77,0.15);
}

/* Responsive */
@media (max-width: 767px) {
    .auth-card { grid-template-columns: 1fr; max-width: 420px; }
    .auth-side { display: none; }
    .auth-body { padding: 2rem 1.5rem; }
    .auth-body .mobile-logo { display: block; }
}

/* ===== Dashboard ===== */
.panel-header {
    background: var(--pr-dark);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.panel-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
}
.panel-brand img { width: 42px; height: 42px; object-fit: contain; }
.panel-brand h1 { color: #fff; font-size: 1.2rem; font-weight: 800; margin: 0; line-height: 1.2; }
.panel-brand small { color: rgba(255,255,255,0.65); font-size: 0.75rem; }
.panel-actions { display: flex; gap: 0.5rem; }
.panel-btn {
    background: var(--pr-primary);
    color: #fff;
    border: 0;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.panel-btn:hover { background: var(--pr-primary-hover); color: #fff; }
.panel-btn.ghost {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}
.panel-btn.ghost:hover { background: rgba(255,255,255,0.2); }

.panel-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 6rem;
}

.balance-card {
    background: linear-gradient(135deg, #F74D4D 0%, #c026d3 100%);
    color: #fff;
    border-radius: 18px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(247,77,77,0.25);
}
.balance-card::before {
    content:"";
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    top: -80px; right: -80px;
}
.balance-card::after {
    content:"";
    position: absolute;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    bottom: -60px; left: 30%;
}
.balance-card .balance-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.35rem;
    display: flex; align-items: center; gap: 0.4rem;
    position: relative; z-index: 1;
}
.balance-card .balance-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    position: relative; z-index: 1;
    margin-bottom: 0.75rem;
}
.balance-card .balance-meta {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    position: relative; z-index: 1;
}
.balance-card .balance-add {
    background: #fff;
    color: var(--pr-primary);
    border: 0;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}
.balance-card .balance-refresh {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 0;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.balance-card .balance-refresh:hover { background: rgba(255,255,255,0.25); }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.action-tile {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 0.75rem;
    text-align: center;
    border: 1px solid var(--pr-border);
    transition: all 0.2s ease;
    color: var(--pr-heading);
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.action-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); color: var(--pr-primary); }
.action-tile .icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}
.icon-mobile { background: #3b82f6; }
.icon-dth { background: #8b5cf6; }
.icon-wallet { background: var(--pr-success); }
.icon-margin { background: var(--pr-warn); }
.action-tile .label { font-weight: 600; font-size: 0.9rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.1rem;
    border: 1px solid var(--pr-border);
}
.stat-card .stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 0.6rem;
    font-size: 1.1rem;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--pr-text);
    margin-bottom: 0.2rem;
}
.stat-card .stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--pr-heading);
}
.stat-icon.bg-green { background: rgba(16,185,129,0.12); color: var(--pr-success); }
.stat-icon.bg-blue { background: rgba(59,130,246,0.12); color: var(--pr-info); }
.stat-icon.bg-red { background: rgba(247,77,77,0.12); color: var(--pr-primary); }

.panel-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pr-heading);
    margin-bottom: 0.75rem;
    display: flex; align-items: center; justify-content: space-between;
}

.history-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--pr-border);
    overflow: hidden;
}
.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--pr-border);
}
.history-table th {
    background: #f9fafb;
    font-weight: 700;
    color: var(--pr-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.history-table tr:last-child td { border-bottom: 0; }
.history-table tbody tr:hover { background: #fafbfc; }
.status-pill {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}
.status-success { background: rgba(16,185,129,0.12); color: var(--pr-success); }
.status-pending { background: rgba(245,158,11,0.12); color: var(--pr-warn); }
.status-failed { background: rgba(247,77,77,0.12); color: var(--pr-primary); }

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--pr-border);
    display: none;
    justify-content: space-around;
    padding: 0.6rem 0;
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 600;
}
.bottom-nav a i { font-size: 1.15rem; }
.bottom-nav a.active { color: var(--pr-primary); }

@media (max-width: 767px) {
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .balance-card .balance-value { font-size: 1.9rem; }
    .bottom-nav { display: flex; }
    .panel-container { padding-bottom: 5rem; }
    .history-table th:nth-child(3), .history-table td:nth-child(3) { display: none; }
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: skl 1.5s infinite linear;
    border-radius: 6px;
    color: transparent !important;
}
@keyframes skl {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
