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

:root {
    --np-card-bg:        #ffffff;
    --np-card-border:    rgba(15, 23, 42, 0.05);
    --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:    #0f172a;
    --np-text:           #1f2937;
    --np-text-muted:     #6b7280;
    --np-text-faint:     #9ca3af;
    --np-divider:        rgba(15, 23, 42, 0.06);
    --np-accent:         #0ea5e9;
    --np-accent-hover:   #0284c7;
    --np-accent-soft:    #e0f2fe;
    --np-accent-ink:     #075985;
    --np-danger:         #ef4444;
    --np-warn:           #f59e0b;
    --np-warn-soft:      #fef3c7;
    --np-warn-border:    #fbbf24;
    --np-quicklink-bg:   #f3f4f6;
}

body:not(.dark-theme) {
    --np-card-bg:        #16161a;
    --np-card-border:    rgba(255, 255, 255, 0.06);
    --np-card-shadow:    0 2px 8px rgba(0, 0, 0, 0.4);
    --np-text-strong:    #f5f5f4;
    --np-text:           #e5e5e4;
    --np-text-muted:     #a8a29e;
    --np-text-faint:     #78716c;
    --np-divider:        rgba(255, 255, 255, 0.08);
    --np-accent-soft:    rgba(14, 165, 233, 0.15);
    --np-accent-ink:     #7dd3fc;
    --np-warn-soft:      rgba(245, 158, 11, 0.12);
    --np-warn-border:    rgba(245, 158, 11, 0.45);
    --np-quicklink-bg:   #1c1c20;
}

/* ===== 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: rgba(245, 158, 11, 0.22);
    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: #c81d1d; 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, #3b5cf5 0%, #4f4ef8 50%, #6a4ef5 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 rgba(255, 255, 255, 0.18);
    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 rgba(255, 255, 255, 0.18);
        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: #e5e7eb;
    color: var(--np-text-strong);
    transform: translateY(-1px);
}
body:not(.dark-theme) .np-quicklink:hover { background: #26262b; 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: #e0f2fe; --np-s2: #ede9fe; }
.np-stat.np-c-2 { --np-s1: #fce7f3; --np-s2: #ede9fe; }
.np-stat.np-c-3 { --np-s1: #fef3c7; --np-s2: #fee2e2; }
.np-stat.np-c-4 { --np-s1: #d1fae5; --np-s2: #cffafe; }
.np-stat.np-c-5 { --np-s1: #ede9fe; --np-s2: #ddd6fe; }
.np-stat.np-c-6 { --np-s1: #fed7aa; --np-s2: #fecaca; }
.np-stat.np-c-7 { --np-s1: #ccfbf1; --np-s2: #e0e7ff; }
.np-stat.np-c-8 { --np-s1: #f3e8ff; --np-s2: #fce7f3; }

body:not(.dark-theme) .np-stat.np-c-1 { --np-s1: #0ea5e9; --np-s2: #38bdf8; }
body:not(.dark-theme) .np-stat.np-c-2 { --np-s1: #ec4899; --np-s2: #38bdf8; }
body:not(.dark-theme) .np-stat.np-c-3 { --np-s1: #f59e0b; --np-s2: #ef4444; }
body:not(.dark-theme) .np-stat.np-c-4 { --np-s1: #10b981; --np-s2: #06b6d4; }
body:not(.dark-theme) .np-stat.np-c-5 { --np-s1: #38bdf8; --np-s2: #0ea5e9; }
body:not(.dark-theme) .np-stat.np-c-6 { --np-s1: #f97316; --np-s2: #f43f5e; }
body:not(.dark-theme) .np-stat.np-c-7 { --np-s1: #14b8a6; --np-s2: #0ea5e9; }
body:not(.dark-theme) .np-stat.np-c-8 { --np-s1: #0ea5e9; --np-s2: #ec4899; }

/* ===== 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: #059669; font-weight: 600; white-space: nowrap; }
.np-txn-amount-neg { color: #dc2626; 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;
}
