/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(180deg, #F3EEFF 0%, #FBF9F6 35%);
    min-height: 100vh;
    color: #1F2937;
    padding: 24px 18px 40px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 460px;
    margin: 0 auto;
}

/* ===== Top bar ===== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.greeting p {
    font-size: 0.9rem;
    color: #6B7280;
    margin-bottom: 4px;
}

.greeting h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    letter-spacing: -0.3px;
}

.bell-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1F2937;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

.bell-btn svg {
    width: 20px;
    height: 20px;
}

.bell-dot {
    position: absolute;
    top: 11px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: #EF4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* ===== Section title ===== */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 14px;
    letter-spacing: -0.2px;
}

/* ===== Wallet / Credit Card ===== */
.wallet {
    margin-bottom: 24px;
}

.credit-card {
    background: linear-gradient(135deg, #2D1B69 0%, #5B3FD9 60%, #7C3AED 100%);
    border-radius: 22px;
    padding: 26px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(91, 63, 217, 0.3);
}

.credit-card::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -25%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.credit-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    position: relative;
    z-index: 1;
}

.card-brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.card-visa {
    font-size: 0.85rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 1.2px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
}

.card-middle {
    margin-bottom: 36px;
    position: relative;
    z-index: 1;
}

.card-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    font-weight: 400;
}

.card-balance {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.card-stats {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stat {
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    font-variant-numeric: tabular-nums;
}

.stat.income {
    color: #6EE7B7;
}

.stat.expense {
    color: #FCA5A5;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

/* ===== Action buttons ===== */
.actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.action-btn {
    background: #fff;
    border: none;
    border-radius: 16px;
    padding: 18px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.06);
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.12);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #EDE9FE;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7C3AED;
}

.action-icon svg {
    width: 22px;
    height: 22px;
}

.action-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #1F2937;
}

/* ===== Transactions ===== */
.transactions {
    margin-bottom: 28px;
}

.txn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.txn-header .section-title {
    margin-bottom: 0;
}

.filters {
    display: flex;
    gap: 4px;
    background: #F3F4F6;
    border-radius: 20px;
    padding: 3px;
}

.filter-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #6B7280;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-btn:hover {
    color: #1F2937;
}

.filter-btn.active {
    background: #fff;
    color: #1F2937;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.txn-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.txn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s;
}

.txn:hover {
    transform: translateX(2px);
}

.txn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #EDE9FE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.txn-info {
    flex: 1;
    min-width: 0;
}

.txn-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.txn-meta {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: capitalize;
}

.txn-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.txn-amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1F2937;
    font-variant-numeric: tabular-nums;
}

.txn-amount.income {
    color: #10B981;
}

.txn-amount.expense {
    color: #EF4444;
}

.txn-del {
    background: transparent;
    border: none;
    color: #D1D5DB;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.txn-del:hover {
    color: #EF4444;
    background: #FEF2F2;
}

.empty-state {
    text-align: center;
    color: #9CA3AF;
    padding: 30px 0;
    font-style: italic;
    font-size: 0.9rem;
}

.empty-state.hidden {
    display: none;
}

/* ===== Add form ===== */
.add-form {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.06);
    margin-bottom: 30px;
}

.add-form .section-title {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-size: 0.75rem;
    color: #6B7280;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-field input,
.form-field select {
    padding: 11px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #F9FAFB;
    color: #1F2937;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #7C3AED;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #7C3AED 0%, #5B3FD9 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s, transform 0.1s;
    font-family: inherit;
}

.btn-primary:hover {
    opacity: 0.92;
}

.btn-primary:active {
    transform: scale(0.99);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    body {
        padding: 20px 14px 36px;
    }

    .greeting h1 {
        font-size: 1.35rem;
    }

    .card-balance {
        font-size: 1.95rem;
    }

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