/**
 * PlumePay — additions layered on top of the base dashboard stylesheet.
 * Only new components live here; nothing in style.css is overridden blindly.
 */

:root {
    --pp-primary: #1652F0;
    --pp-dark: #070707;
    --pp-success: #51BB25;
    --pp-danger: #DC3545;
    --pp-warning: #F8D62B;
    --pp-muted: #a2a5b9;
    --pp-line: rgba(162, 165, 185, .22);

    /* Width of the fixed sidebar rail, and the height it becomes on mobile. */
    --pp-rail: 80px;
    --pp-rail-mobile: 50px;
}

/* ═══ Layout corrections ═══════════════════════════════════════════════════
 *
 * The base stylesheet has three layout faults that this section corrects.
 * They are overridden here rather than edited in place, so the vendor
 * stylesheet stays replaceable.
 *
 *  1. .footer is `position: fixed; left: 110px`, so it floats over the page
 *     instead of ending it, and 110px is the wrapper's *vertical* offset
 *     mistaken for a horizontal one — the rail is 80px wide.
 *
 *  2. .content-body sets `margin-left: 80px` to clear that rail, then removes
 *     it again at `min-width: 576px`, so on every screen above 576px the
 *     content slides underneath the sidebar.
 *
 *  3. .header is pinned `left: 80px` at all widths, but below 768px the rail
 *     becomes a full-width bottom bar, leaving the header indented against
 *     nothing.
 */

/* The footer ends the page; it does not hover over it. */
.footer {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--pp-line);
    border-radius: 0;
    background: transparent;
}

.footer .copyright p {
    font-size: 13.5px;
}

/* Desktop: clear the vertical rail. */
@media (min-width: 768px) {
    .content-body,
    .footer {
        margin-left: var(--pp-rail);
    }

    .header {
        left: var(--pp-rail);
    }
}

/* Mobile: the rail is a bottom bar, so nothing is indented and the page
   needs room to scroll clear of it. */
@media (max-width: 767px) {
    .header {
        left: 0;
    }

    .content-body {
        margin-left: 0;
        margin-bottom: calc(var(--pp-rail-mobile) + 16px);
    }

    .footer {
        margin-left: 0;
        margin-bottom: var(--pp-rail-mobile);
    }
}

body.dark-theme .footer {
    border-top-color: rgba(255, 255, 255, .08);
}

/* ─── Unread notification counter on the bell ─────────────────────────── */
.notify-bell {
    position: relative;
}

.pp-badge-dot {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--pp-danger);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* ─── Initial-based avatar, replacing the stock stock-photo thumbs ─────── */
.pp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--pp-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    flex-shrink: 0;
}

.pp-avatar-lg {
    width: 84px;
    height: 84px;
    font-size: 28px;
}

/* ─── Empty states ────────────────────────────────────────────────────── */
.pp-empty {
    padding: 46px 24px;
    text-align: center;
    color: var(--pp-muted);
}

.pp-empty i {
    display: block;
    margin-bottom: 12px;
    font-size: 40px;
    opacity: .5;
}

.pp-empty p {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 500;
}

.pp-empty span {
    display: block;
    margin-bottom: 18px;
    font-size: 13px;
}

.pp-empty-sm {
    padding: 26px 16px;
}

.pp-empty-sm i {
    margin-bottom: 6px;
    font-size: 26px;
}

/* ─── Status pills ────────────────────────────────────────────────────── */
.pp-pill {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    line-height: 1.5;
}

.pp-pill-success {
    background: rgba(81, 187, 37, .12);
    color: var(--pp-success);
}

.pp-pill-warning {
    background: rgba(248, 214, 43, .16);
    color: #b8930a;
}

.pp-pill-danger {
    background: rgba(220, 53, 69, .12);
    color: var(--pp-danger);
}

.pp-pill-secondary {
    background: rgba(162, 165, 185, .16);
    color: var(--pp-muted);
}

/* ─── Ledger amounts ──────────────────────────────────────────────────── */
.pp-amount {
    font-weight: 600;
    white-space: nowrap;
}

.pp-amount-credit {
    color: var(--pp-success);
}

.pp-amount-debit {
    color: var(--pp-danger);
}

/* ─── Transaction type icon ───────────────────────────────────────────── */
.pp-tx-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 17px;
    flex-shrink: 0;
}

.pp-tx-icon-credit {
    background: rgba(81, 187, 37, .12);
    color: var(--pp-success);
}

.pp-tx-icon-debit {
    background: rgba(220, 53, 69, .1);
    color: var(--pp-danger);
}

/* ─── Flash messages ──────────────────────────────────────────────────── */
.pp-flash {
    border: 0;
    border-left: 3px solid currentColor;
    border-radius: 6px;
    font-size: 14px;
}

/* ─── Tables ──────────────────────────────────────────────────────────── */
.pp-table {
    width: 100%;
    margin-bottom: 0;
}

.pp-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--pp-line);
    color: var(--pp-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.pp-table td {
    padding: 14px;
    border-bottom: 1px solid var(--pp-line);
    font-size: 14px;
    vertical-align: middle;
}

.pp-table tbody tr:last-child td {
    border-bottom: 0;
}

.pp-table-wrap {
    overflow-x: auto;
}

.pp-mono {
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

/* ─── Key/value definition rows ───────────────────────────────────────── */
.pp-kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--pp-line);
}

.pp-kv:last-child {
    border-bottom: 0;
}

.pp-kv > p {
    margin: 0;
    color: var(--pp-muted);
    font-size: 13px;
}

.pp-kv > h5 {
    margin: 0;
    font-size: 14px;
    text-align: right;
    word-break: break-word;
}

/* ─── One-time secret reveal ──────────────────────────────────────────── */
.pp-secret {
    display: block;
    padding: 14px 16px;
    border: 1px dashed var(--pp-primary);
    border-radius: 8px;
    background: rgba(22, 82, 240, .05);
    color: var(--pp-primary);
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    word-break: break-all;
}

/* ─── Toolbar above tables ────────────────────────────────────────────── */
.pp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.pp-toolbar .form-control,
.pp-toolbar .form-select {
    width: auto;
    min-width: 140px;
}

/* ─── Pagination ──────────────────────────────────────────────────────── */
.pp-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
}

.pp-pager span {
    color: var(--pp-muted);
    font-size: 13px;
}

/* ─── Field-level validation copy ─────────────────────────────────────── */
.pp-error {
    display: block;
    margin-top: 5px;
    color: var(--pp-danger);
    font-size: 12.5px;
}

.pp-hint {
    display: block;
    margin-top: 5px;
    color: var(--pp-muted);
    font-size: 12.5px;
}

/* ─── OTP entry ───────────────────────────────────────────────────────── */
.pp-otp-input {
    letter-spacing: 14px;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
}

/* ═══ Polish pass ══════════════════════════════════════════════════════════
 * Brings the dashboard up to the standard of the marketing site without
 * fighting the base template: same palette, same radii, same restraint.
 */

/* ─── Cards ───────────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--pp-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(10, 13, 26, .04), 0 12px 28px -14px rgba(10, 13, 26, .12);
    transition: box-shadow .2s cubic-bezier(.22, .8, .3, 1);
}

.card-header {
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--pp-line);
}

.card-header .card-title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -.012em;
}

.card-body {
    padding: 22px;
}

/* ─── Page heading ────────────────────────────────────────────────────── */
.page-title {
    margin-bottom: 26px;
    padding-bottom: 0;
}

.page-title-content h3 {
    margin-bottom: 2px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.024em;
}

.page-title-content p {
    color: var(--pp-muted);
    font-size: 14px;
}

.breadcrumbs {
    font-size: 13.5px;
}

/* ─── Stat tiles ──────────────────────────────────────────────────────── */
.stat-widget .widget-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 19px;
    flex-shrink: 0;
}

.stat-widget .widget-content h3 {
    margin-bottom: 0;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.026em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.stat-widget .widget-content p {
    margin: 2px 0 0;
    color: var(--pp-muted);
    font-size: 13px;
    line-height: 1.35;
}

/* ─── Forms ───────────────────────────────────────────────────────────── */
.form-label {
    margin-bottom: 7px;
    color: var(--pp-muted);
    font-size: 13px;
    font-weight: 600;
}

.form-control,
.form-select {
    padding: 11px 14px;
    border: 1.5px solid var(--pp-line);
    border-radius: 10px;
    font-size: 14.5px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--pp-primary);
    box-shadow: 0 0 0 4px rgba(22, 82, 240, .1);
}

.form-control.is-invalid {
    border-color: var(--pp-danger);
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    transition: transform .16s cubic-bezier(.22, .8, .3, 1), box-shadow .16s ease, background .16s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-sm { padding: 8px 15px; font-size: 13px; }

.btn-primary {
    border-color: transparent;
    background: var(--pp-primary);
    box-shadow: 0 6px 16px -8px rgba(22, 82, 240, .8);
}

.btn-primary:hover {
    background: #0B3BC4;
    box-shadow: 0 10px 22px -8px rgba(22, 82, 240, .9);
}

.btn:disabled,
.btn.disabled {
    transform: none;
    box-shadow: none;
    opacity: .5;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────── */
.menu ul li a {
    border-radius: 12px;
    transition: background .16s ease, color .16s ease;
}

.menu ul li.active > a,
.menu ul li a.active {
    background: rgba(255, 255, 255, .16);
}

.menu ul li a:hover {
    background: rgba(255, 255, 255, .1);
}

/* ─── Settings sub-nav ────────────────────────────────────────────────── */
.settings-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 26px;
    padding-bottom: 2px;
}

.settings-menu a {
    padding: 9px 16px;
    border-radius: 999px;
    color: var(--pp-muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease;
}

.settings-menu a:hover {
    background: rgba(22, 82, 240, .08);
    color: var(--pp-primary);
    text-decoration: none;
}

.settings-menu a.active {
    background: var(--pp-primary);
    color: #fff;
}

/* ─── Tables ──────────────────────────────────────────────────────────── */
.pp-table tbody tr {
    transition: background .14s ease;
}

.pp-table tbody tr:hover {
    background: rgba(22, 82, 240, .035);
}

.pp-table td a {
    font-weight: 600;
}

/* ─── Alerts ──────────────────────────────────────────────────────────── */
.pp-flash {
    margin-bottom: 22px;
    padding: 13px 18px;
}

/* ─── Credit card widget ──────────────────────────────────────────────── */
.credit-card {
    border-radius: 16px;
    background: linear-gradient(140deg, #1652F0 0%, #0B36B8 55%, #7B5CFF 100%);
    box-shadow: 0 14px 32px -16px rgba(22, 82, 240, .8);
}

/* ─── Dark theme parity ───────────────────────────────────────────────── */
body.dark-theme .card {
    border-color: rgba(255, 255, 255, .07);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -14px rgba(0, 0, 0, .6);
}

body.dark-theme .card-header,
body.dark-theme .pp-table th,
body.dark-theme .pp-table td,
body.dark-theme .pp-kv {
    border-color: rgba(255, 255, 255, .07);
}

body.dark-theme .pp-table th {
    color: #7a7d92;
}

body.dark-theme .pp-table tbody tr:hover {
    background: rgba(255, 255, 255, .035);
}

body.dark-theme .form-control,
body.dark-theme .form-select {
    border-color: rgba(255, 255, 255, .1);
}

body.dark-theme .pp-secret {
    background: rgba(22, 82, 240, .14);
}

body.dark-theme .settings-menu a:hover {
    background: rgba(22, 82, 240, .18);
}

/* ─── Motion preference ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .card, .btn, .menu ul li a, .settings-menu a, .pp-table tbody tr {
        transition: none;
    }
    .btn:hover { transform: none; }
}
