:root {
    --bg: #f6f1eb;
    --surface: #ffffff;
    --surface-soft: #fffaf5;
    --ink: #2a1b16;
    --muted: #806f67;
    --line: #eaded5;
    --primary: #5a3023;
    --primary-dark: #3d2018;
    --accent: #c98b53;
    --danger: #b42318;
    --success: #18794e;
    --shadow: 0 24px 70px rgba(70, 39, 25, 0.12);
    --font-fa: "B Yekan", "B Yekan+", "BYekan", Tahoma, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(201, 139, 83, 0.14), transparent 32rem),
        var(--bg);
    color: var(--ink);
    font-family: var(--font-fa);
    line-height: 1.8;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.site-header {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    font-size: 1.3rem;
}

.nav-links,
.hero-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.nav-user {
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.hero {
    display: grid;
    min-height: calc(100vh - 100px);
    align-items: center;
    padding: 48px 0 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    align-items: center;
    gap: 72px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 700;
}

.eyebrow::before {
    width: 28px;
    height: 2px;
    background: var(--accent);
    content: "";
}

.hero h1 {
    max-width: 650px;
    margin: 0 0 22px;
    color: var(--primary-dark);
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 1.25;
}

.hero p {
    max-width: 560px;
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 1.15rem;
}

.hero-card {
    position: relative;
    min-height: 390px;
    overflow: hidden;
    padding: 34px;
    border-radius: 34px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent),
        linear-gradient(145deg, var(--primary), #24130e);
    box-shadow: var(--shadow);
    color: #fff;
}

.hero-card::after {
    position: absolute;
    right: -90px;
    bottom: -120px;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.03), 0 0 0 68px rgba(255, 255, 255, 0.03);
    content: "";
}

.hero-card-content {
    position: relative;
    z-index: 1;
}

.hero-card h2 {
    max-width: 320px;
    margin: 24px 0 16px;
    font-size: 2rem;
    line-height: 1.45;
}

.hero-card p {
    color: rgba(255, 255, 255, 0.76);
    font-size: 1rem;
}

.btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--primary);
}

.btn-ghost {
    color: var(--primary);
}

.btn-small {
    min-height: 40px;
    padding: 7px 15px;
    border-radius: 11px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

.auth-page {
    display: grid;
    min-height: calc(100vh - 100px);
    place-items: center;
    padding: 30px 0 70px;
}

.auth-card {
    width: min(100%, 470px);
    padding: clamp(26px, 5vw, 44px);
    border: 1px solid rgba(234, 222, 213, 0.9);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.auth-card-wide {
    width: min(100%, 700px);
}

.auth-heading {
    margin-bottom: 28px;
    text-align: center;
}

.auth-heading h1 {
    margin: 14px 0 8px;
    color: var(--primary-dark);
    font-size: 2rem;
}

.auth-heading p,
.page-heading p,
.panel-heading p {
    margin: 0;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    background: #f8ecdf;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
}

.badge-light {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 54px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: 0;
    background: var(--surface-soft);
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(201, 139, 83, 0.16);
}

.field input[type="file"] {
    padding: 8px 12px;
}

.field small,
.field-hint {
    display: block;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.field-hint {
    margin-top: -6px;
    margin-bottom: 18px;
}

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

.form-actions .btn {
    width: 100%;
}

.auth-footer {
    margin-top: 24px;
    color: var(--muted);
    text-align: center;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 800;
}

.alert {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 13px;
    font-size: 0.95rem;
}

.alert-error {
    background: #fff0ef;
    color: var(--danger);
}

.alert-success {
    background: #edf9f2;
    color: var(--success);
}

.flash-stack {
    padding-top: 4px;
}

.login-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    padding: 5px;
    border-radius: 16px;
    background: #f7eee7;
}

.tab-button {
    min-height: 43px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
}

.tab-button.is-active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 5px 15px rgba(70, 39, 25, 0.08);
}

.otp-input {
    direction: ltr;
    font-size: 2rem !important;
    letter-spacing: 0.35em;
    text-align: center;
}

.otp-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 18px;
    padding: 11px 14px;
    border-radius: 13px;
    background: #fff8ee;
    color: var(--muted);
    font-size: 0.9rem;
}

.otp-status strong {
    color: var(--primary);
    direction: ltr;
}

.resend-form {
    margin-top: 12px;
}

.site-footer {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0 34px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 0.9rem;
}

.page-shell {
    padding: 44px 0 80px;
}

.page-heading,
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.page-heading h1,
.dashboard-hero h1 {
    margin: 0 0 8px;
    color: var(--primary-dark);
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.dashboard-hero {
    padding: clamp(25px, 5vw, 50px);
    border-radius: 30px;
    background: linear-gradient(140deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow);
    color: #fff;
}

.dashboard-hero h1 {
    color: #fff;
}

.dashboard-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
}

.dashboard-hero .eyebrow {
    color: #eabf92;
}

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

.dashboard-card,
.panel,
.empty-state {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 35px rgba(70, 39, 25, 0.06);
}

.dashboard-card {
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.dashboard-card h2,
.panel h2,
.empty-state h2 {
    margin: 12px 0 6px;
    color: var(--primary-dark);
    font-size: 1.25rem;
}

.dashboard-card p,
.empty-state p {
    margin: 0;
    color: var(--muted);
}

.card-icon,
.empty-icon {
    color: var(--accent);
    font-size: 2rem;
    font-weight: 800;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
    gap: 18px;
}

.profile-layout .panel:last-child {
    grid-column: 1 / -1;
}

.panel-financial {
    grid-column: 1 / -1;
}

.panel-heading {
    margin-bottom: 22px;
}

.panel-heading h2 {
    margin-top: 0;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.profile-summary h2 {
    margin: 0 0 3px;
}

.profile-summary p {
    margin: 0 0 8px;
    color: var(--muted);
}

.avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #f5e4d5;
    color: var(--primary);
    object-fit: cover;
    font-weight: 800;
}

.avatar-large {
    width: 92px;
    height: 92px;
    border: 4px solid rgba(255, 255, 255, 0.32);
    font-size: 2rem;
}

.avatar-xl {
    width: 82px;
    height: 82px;
    font-size: 1.7rem;
}

.status-pill {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-active {
    background: #e6f6ec;
    color: var(--success);
}

.status-paid {
    background: #e6f6ec;
    color: var(--success);
}

.status-under_review,
.status-pending,
.status-redirected {
    background: #fff8ee;
    color: #9a641d;
}

.status-rejected,
.status-failed,
.status-cancelled {
    background: #fff0ef;
    color: var(--danger);
}

.account-details {
    display: grid;
    gap: 0;
    margin: 0;
}

.account-details div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.account-details dt {
    color: var(--muted);
}

.account-details dd {
    margin: 0;
    color: var(--primary-dark);
    font-weight: 700;
}

.financial-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.financial-summary div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.financial-summary span {
    color: var(--muted);
    font-size: 0.82rem;
}

.financial-summary strong {
    color: var(--primary-dark);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.empty-state {
    padding: 70px 25px;
    text-align: center;
}

.compact-empty {
    padding: 38px 20px;
    border: 0;
    box-shadow: none;
}

.empty-state h2 {
    font-size: 1.7rem;
}

.wallet-balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: clamp(25px, 5vw, 42px);
    border-radius: 28px;
    background: linear-gradient(140deg, #3d2018, #7a432d);
    box-shadow: var(--shadow);
    color: #fff;
}

.wallet-balance-card span,
.wallet-balance-card small {
    display: block;
    color: rgba(255, 255, 255, 0.72);
}

.wallet-balance-card strong {
    display: inline-block;
    margin-top: 4px;
    font-size: clamp(2.1rem, 6vw, 4rem);
    line-height: 1.2;
}

.wallet-balance-card small {
    display: inline-block;
    margin-right: 8px;
}

.wallet-balance-meta {
    min-width: 150px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 15px;
    text-align: center;
}

.wallet-balance-meta strong {
    display: block;
    font-size: 1.1rem;
}

.wallet-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.wallet-history {
    overflow: hidden;
}

.panel-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.filter-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.filter-links a {
    padding: 5px 11px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.filter-links a.is-active {
    background: #f8ecdf;
    color: var(--primary);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-top: 1px solid var(--line);
    text-align: right;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.data-table td small {
    display: block;
    color: var(--muted);
}

.transaction-pill {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.transaction-credit {
    background: #e6f6ec;
    color: var(--success);
}

.transaction-debit {
    background: #fff0ef;
    color: var(--danger);
}

.amount-credit {
    color: var(--success);
    font-weight: 800;
}

.amount-debit {
    color: var(--danger);
    font-weight: 800;
}

.deposit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.bank-destination {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-soft);
}

.bank-destination div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.bank-destination span {
    color: var(--muted);
}

.bank-destination strong {
    color: var(--primary-dark);
}

.text-link {
    color: var(--primary);
    font-weight: 800;
}

.admin-table {
    min-width: 1100px;
}

.admin-actions {
    display: grid;
    gap: 8px;
    min-width: 250px;
}

.admin-actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-actions form input[type="text"] {
    min-width: 150px;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.reject-form input {
    min-width: 150px;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

@media (max-width: 820px) {
    .hero-grid,
    .profile-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .deposit-grid,
    .wallet-actions-grid {
        grid-template-columns: 1fr;
    }

    .profile-layout .panel:last-child {
        grid-column: auto;
    }

    .panel-financial {
        grid-column: auto;
    }

    .hero-card {
        min-height: 280px;
    }
}

@media (max-width: 540px) {
    .site-header,
    .container,
    .site-footer {
        width: min(100% - 28px, 1120px);
    }

    .nav-user {
        display: none;
    }

    .hero {
        padding-top: 24px;
    }

    .hero-card {
        padding: 26px;
        border-radius: 24px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .financial-summary {
        grid-template-columns: 1fr;
    }

    .page-heading,
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .wallet-balance-card,
    .panel-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .wallet-balance-meta {
        width: 100%;
    }
}
