/* =========================
   BASE
========================= */
body {
    background: #f3f5fb;
    font-family: 'Segoe UI', sans-serif;
    margin-bottom: 80px;
}

/* Automatic RTL/LTR support */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] body {
    direction: ltr;
    text-align: left;
}

.app {
    max-width: 420px;
    margin: auto;
    padding: 20px 16px 0;
    box-sizing: border-box;
}

/* =========================
   HEADER
========================= */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

/* Keep header layout stable in RTL */
html[dir="rtl"] .top-header {
    flex-direction: row;
}

/* Optional: flip back arrow icon automatically */
html[dir="rtl"] .back-icon i {
    transform: rotate(180deg);
}

/* =========================
   PROFILE CARD
========================= */
.profile-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.profile-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d1b2a, #1b263b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 40px;
}

.profile-info h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.profile-info p {
    margin: 2px 0;
    font-size: 13px;
    color: #6b7280;
}

/* =========================
   WALLET
========================= */
.wallet-card {
    background: linear-gradient(135deg, #0d1b2a, #1b263b);
    color: white;
    border-radius: 20px;
    padding: 22px;
    margin: 20px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.wallet-footer {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    opacity: 0.8;
}

/* Reverse wallet footer in RTL */
html[dir="rtl"] .wallet-footer {
    flex-direction: row-reverse;
}

/* =========================
   ANALYTICS
========================= */
.analytics {
    display: flex;
    gap: 10px;
}

/* Reverse analytics cards in RTL */
html[dir="rtl"] .analytics {
    flex-direction: row-reverse;
}

.analytic-card {
    background: white;
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

/* =========================
   ACTION GRID
========================= */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 25px 0;
}

.action-box {
    background: white;
    border-radius: 16px;
    padding: 14px 8px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
}

.action-box i {
    font-size: 22px;
    color: #0d1b2a;
}

.action-box span {
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

.action-box:hover {
    transform: translateY(-3px);
    transition: 0.2s ease;
}

/* =========================
   TRANSACTIONS
========================= */
.transaction-section {
    margin-top: 20px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Reverse section title in RTL */
html[dir="rtl"] .section-title {
    flex-direction: row-reverse;
}

.transaction-item {
    background: white;
    padding: 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Reverse transaction layout in RTL */
html[dir="rtl"] .transaction-item {
    flex-direction: row-reverse;
}

.transaction-item i {
    font-size: 18px;
}

.details small {
    color: #6c757d;
}

.credit {
    color: green;
    font-weight: 600;
}

.debit {
    color: red;
    font-weight: 600;
}

/* =========================
   BOTTOM NAV
========================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: white;
    display: flex;
    justify-content: center;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.12);
}

.bottom-nav > div {
    max-width: 420px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 14px 0;
}

/* Reverse bottom nav in RTL */
html[dir="rtl"] .bottom-nav > div {
    flex-direction: row-reverse;
}

.bottom-nav i {
    font-size: 22px;
    color: #6c757d;
}

.bottom-nav .active {
    color: #0d1b2a;
}
