/* =========================================================================
   UNIFIED DASHBOARD — Neovest mockup
   Same component set + visual treatment at every breakpoint.
   Load AFTER pill-nav.css.
   ========================================================================= */

:root {
    --np-card-bg:        var(--bx-surface);
    --np-card-border:    var(--bx-border);
    --np-card-shadow:    0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    --np-card-radius:    18px;
    --np-text-strong:    var(--bx-text);
    --np-text:           var(--bx-text);
    --np-text-muted:     var(--bx-text-2);
    --np-text-faint:     var(--bx-text-3);
    --np-divider:        var(--bx-border);
    --np-accent:         var(--bx-accent);
    --np-accent-hover:   var(--bx-accent);
    --np-accent-soft:    var(--bx-accent-light);
    --np-accent-ink:     var(--bx-accent-ink);
    --np-danger:         var(--bx-danger);
    --np-warn:           var(--bx-warn);
    --np-warn-soft:      var(--bx-gold);
    --np-warn-border:    var(--bx-gold);
    --np-quicklink-bg:   var(--bx-bg);
}

body:not(.dark-theme) {
    --np-card-bg:        var(--bx-surface);
    --np-card-border:    var(--bx-border);
    --np-card-shadow:    0 2px 8px rgba(0, 0, 0, 0.4);
    --np-text-strong:    var(--bx-text);
    --np-text:           var(--bx-text);
    --np-text-muted:     var(--bx-text-2);
    --np-text-faint:     var(--bx-text-3);
    --np-divider:        var(--bx-border);
    --np-accent-soft:    var(--bx-accent-soft);
    --np-accent-ink:     var(--bx-accent-ink);
    --np-warn-soft:      var(--bx-warn-soft);
    --np-warn-border:    var(--bx-warn-soft);
    --np-quicklink-bg:   var(--bx-surface-2);
}

/* ===== Container ===== */
.np-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 24px;
    max-width: 100%;
    animation: npFadeIn 0.4s ease-out;
}
@keyframes npFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Generic card ===== */
.np-card {
    background: var(--np-card-bg);
    border: 1px solid var(--np-card-border);
    border-radius: var(--np-card-radius);
    box-shadow: var(--np-card-shadow);
    padding: 20px;
    position: relative;
}
.np-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--np-text-strong);
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

/* ===== KYC alert (dashed orange banner) ===== */
.np-kyc-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--np-card-radius);
    border: 2px dashed var(--np-warn-border);
    background: var(--np-warn-soft);
    position: relative;
}
.np-kyc-alert .np-kyc-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bx-warn-soft);
    color: var(--np-warn);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.np-kyc-alert .np-kyc-icon svg,
.np-kyc-alert .np-kyc-icon i { width: 18px; height: 18px; }
.np-kyc-alert .np-kyc-body { flex: 1; min-width: 200px; }
.np-kyc-alert .np-kyc-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--np-text-strong);
    margin: 0 0 2px;
}
.np-kyc-alert .np-kyc-desc {
    font-size: 13px;
    color: var(--np-text-muted);
    margin: 0;
    line-height: 1.4;
}
.np-kyc-alert .np-kyc-desc strong { color: var(--np-text-strong); font-weight: 600; }
.np-kyc-alert .np-kyc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
}
.np-kyc-alert .np-kyc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.np-kyc-alert .np-kyc-btn.is-primary {
    background: var(--np-accent);
    color: #ffffff;
}
.np-kyc-alert .np-kyc-btn.is-primary:hover { background: var(--np-accent-hover); color: #fff; }
.np-kyc-alert .np-kyc-btn.is-danger {
    background: var(--np-danger);
    color: #ffffff;
}
.np-kyc-alert .np-kyc-btn.is-danger:hover { background: var(--bx-danger); color: #fff; }
@media (min-width: 768px) {
    .np-kyc-alert { flex-wrap: nowrap; }
    .np-kyc-alert .np-kyc-actions { width: auto; margin-top: 0; }
}

/* ===== Wallets card with blue gradient curved tab ===== */
.np-wallets-card { padding-bottom: 8px; }
.np-wallets-gradient {
    background: linear-gradient(135deg, var(--bx-accent) 0%, var(--bx-accent-light) 50%, var(--bx-accent-light) 100%);
    border-radius: 16px 30px 16px 30px;
    color: #ffffff;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 12px 30px -10px rgba(63, 81, 245, 0.45);
}
.np-wallets-gradient::before,
.np-wallets-gradient::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.np-wallets-gradient::before {
    width: 220px; height: 220px;
    top: -100px; right: -60px;
}
.np-wallets-gradient::after {
    width: 140px; height: 140px;
    bottom: -60px; right: 80px;
    background: rgba(255, 255, 255, 0.05);
}
.np-wallet-row {
    position: relative;
    z-index: 1;
    padding: 6px 0;
}
.np-wallet-row + .np-wallet-row {
    border-top: 1px solid var(--bx-border);
    margin-top: 6px;
    padding-top: 14px;
}
.np-wallet-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    margin: 0 0 4px;
}
.np-wallet-value {
    font-size: 30px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
@media (min-width: 768px) {
    .np-wallets-gradient {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 28px;
        padding: 28px 32px;
    }
    .np-wallet-row + .np-wallet-row {
        border-top: none;
        border-left: 1px solid var(--bx-border);
        margin-top: 0;
        padding-top: 6px;
        padding-left: 28px;
    }
    .np-wallet-value { font-size: 36px; }
}

/* ===== Quick links grid ===== */
.np-quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 540px) { .np-quicklinks-grid { grid-template-columns: repeat(4, 1fr); } }

.np-quicklink {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 8px;
    background: var(--np-quicklink-bg);
    border-radius: 14px;
    color: var(--np-text);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s, transform .15s, border-color .15s;
    min-height: 100px;
}
.np-quicklink:hover {
    background: var(--bx-surface-3);
    color: var(--np-text-strong);
    transform: translateY(-1px);
}
body:not(.dark-theme) .np-quicklink:hover { background: var(--bx-surface-2); color: var(--np-text-strong); }

.np-quicklink-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--np-card-bg);
    color: var(--np-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--np-card-border);
}
.np-quicklink-icon svg,
.np-quicklink-icon i { width: 18px; height: 18px; stroke-width: 1.8; }
.np-quicklink-label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--np-text);
    text-align: center;
    line-height: 1.2;
}

/* ===== Referral URL card ===== */
.np-referral-card { overflow: hidden; }
.np-ref-form {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 8px;
    max-width: 100%;
    position: relative;
    z-index: 1;
}
.np-ref-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1.5px solid var(--np-divider);
    border-right: none;
    border-radius: 999px 0 0 999px;
    padding: 0 16px;
    font-size: 13px;
    color: var(--np-accent);
    background: var(--np-card-bg);
    outline: none;
}
.np-ref-copy {
    height: 44px;
    padding: 0 22px;
    background: var(--np-accent);
    color: #ffffff;
    border: none;
    border-radius: 0 999px 999px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.np-ref-copy:hover { background: var(--np-accent-hover); color: #fff; }
.np-ref-meta {
    font-size: 13px;
    color: var(--np-text-muted);
    margin: 4px 0 14px;
    position: relative;
    z-index: 1;
}
.np-ref-share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.np-ref-share-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--np-text-strong);
}
.np-ref-share-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--np-divider);
    background: var(--np-card-bg);
    color: var(--np-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.np-ref-share-btn:hover { background: var(--np-quicklink-bg); color: var(--np-text-strong); }
.np-ref-share-btn svg { width: 16px; height: 16px; }

.np-ref-illustration {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 140px;
    max-width: 36%;
    pointer-events: none;
    opacity: 0.95;
}
@media (min-width: 768px) {
    .np-ref-illustration { width: 180px; max-width: 30%; }
}

/* ===== Stat tiles (pastel grid) ===== */
.np-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px)  { .np-stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px)  { .np-stats-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .np-stats-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; } }

.np-stat {
    background:
        radial-gradient(120% 100% at 0% 0%, var(--np-s1, #e7f0ff) 0%, transparent 50%),
        radial-gradient(120% 100% at 100% 100%, var(--np-s2, #fde2ec) 0%, transparent 50%),
        var(--np-card-bg);
    border: 1px solid var(--np-card-border);
    border-radius: 18px;
    padding: 18px 16px 16px;
    position: relative;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform .15s, box-shadow .15s;
}
.np-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px -10px rgba(15, 23, 42, 0.20);
}
body:not(.dark-theme) .np-stat {
    background:
        radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--np-s1, #0ea5e9) 22%, transparent) 0%, transparent 60%),
        radial-gradient(120% 100% at 100% 100%, color-mix(in srgb, var(--np-s2, #f54f9f) 18%, transparent) 0%, transparent 60%),
        var(--np-card-bg);
}

.np-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--np-accent-soft);
    color: var(--np-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.08);
}
.np-stat-icon svg,
.np-stat-icon i { width: 16px; height: 16px; stroke-width: 2; }

.np-stat-label {
    font-size: 13px;
    color: var(--np-text-muted);
    margin: 0;
    line-height: 1.2;
}
.np-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--np-text-strong);
    margin: 0;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

/* Pastel color presets — cycled across stats */
.np-stat.np-c-1 { --np-s1: var(--bx-accent-light); --np-s2: var(--bx-accent-soft); }
.np-stat.np-c-2 { --np-s1: var(--bx-violet-soft); --np-s2: var(--bx-accent-soft); }
.np-stat.np-c-3 { --np-s1: var(--bx-gold); --np-s2: var(--bx-danger-soft); }
.np-stat.np-c-4 { --np-s1: var(--bx-success); --np-s2: var(--bx-accent-light); }
.np-stat.np-c-5 { --np-s1: var(--bx-accent-soft); --np-s2: var(--bx-accent-light); }
.np-stat.np-c-6 { --np-s1: var(--bx-warn); --np-s2: var(--bx-danger); }
.np-stat.np-c-7 { --np-s1: var(--bx-success); --np-s2: var(--bx-accent-light); }
.np-stat.np-c-8 { --np-s1: var(--bx-accent-soft); --np-s2: var(--bx-violet-soft); }

body:not(.dark-theme) .np-stat.np-c-1 { --np-s1: var(--bx-accent); --np-s2: var(--bx-accent); }
body:not(.dark-theme) .np-stat.np-c-2 { --np-s1: var(--bx-violet); --np-s2: var(--bx-accent); }
body:not(.dark-theme) .np-stat.np-c-3 { --np-s1: var(--bx-warn); --np-s2: var(--bx-danger); }
body:not(.dark-theme) .np-stat.np-c-4 { --np-s1: var(--bx-success); --np-s2: var(--bx-accent); }
body:not(.dark-theme) .np-stat.np-c-5 { --np-s1: var(--bx-accent); --np-s2: var(--bx-accent); }
body:not(.dark-theme) .np-stat.np-c-6 { --np-s1: var(--bx-warn); --np-s2: var(--bx-danger); }
body:not(.dark-theme) .np-stat.np-c-7 { --np-s1: var(--bx-accent); --np-s2: var(--bx-accent); }
body:not(.dark-theme) .np-stat.np-c-8 { --np-s1: var(--bx-accent); --np-s2: var(--bx-violet); }

/* ===== Recent transactions card / table ===== */
.np-recent-card { padding: 0; overflow: hidden; }
.np-recent-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--np-divider);
}
.np-recent-head .np-card-title { margin: 0; }
.np-recent-scroll { overflow-x: auto; }
.np-txn-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
}
.np-txn-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--np-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 20px;
    background: transparent;
    border-bottom: 1px solid var(--np-divider);
    white-space: nowrap;
}
.np-txn-table tbody td {
    padding: 14px 20px;
    font-size: 13.5px;
    color: var(--np-text);
    border-bottom: 1px solid var(--np-divider);
    vertical-align: middle;
}
.np-txn-table tbody tr:last-child td { border-bottom: none; }
.np-txn-desc {
    display: flex;
    align-items: center;
    gap: 12px;
}
.np-txn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--np-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.np-txn-icon svg,
.np-txn-icon i { width: 16px; height: 16px; color: #fff; }
.np-txn-name {
    font-weight: 600;
    color: var(--np-text-strong);
    font-size: 14px;
    line-height: 1.2;
}
.np-txn-date {
    font-size: 12px;
    color: var(--np-text-faint);
    line-height: 1.2;
    margin-top: 2px;
}
.np-txn-id {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12.5px;
    color: var(--np-text);
    white-space: nowrap;
}
.np-txn-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--np-accent-soft);
    color: var(--np-accent-ink);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.np-txn-amount-pos { color: var(--bx-success-ink); font-weight: 600; white-space: nowrap; }
.np-txn-amount-neg { color: var(--bx-danger-ink); font-weight: 600; white-space: nowrap; }

.np-txn-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--np-text-muted);
    font-size: 14px;
}

/* On narrow screens hide non-essential columns to match the mobile mockup */
@media (max-width: 575px) {
    .np-txn-table thead th:nth-child(n+4),
    .np-txn-table tbody td:nth-child(n+4) { display: none; }
}

/* Hide legacy mobile/desktop wrappers from the dashboard view —
   the unified .np-dashboard replaces them. */
.np-dashboard ~ .mobile-screen-show,
.np-dashboard ~ .desktop-screen-show {
    display: none !important;
}
