:root {
    --primary-blue: #0A84FF;
    --primary-blue-gradient: linear-gradient(135deg, #0A84FF, #005EEA);
    --primary-green: #34C759;
    --primary-green-gradient: linear-gradient(135deg, #34C759, #248A3D);
    --text-orange: #FF9500;

    --bg-color: #F2F2F7;
    --card-bg: #FFFFFF;
    --text-main: #1C1C1E;
    --text-secondary: #8E8E93;

    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 70px;
    /* Space for bottom nav */
}

/* Header Area */
.header-bg {
    background: var(--primary-blue-gradient);
    height: 180px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    padding: 20px 20px 0;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    margin-top: 10px;
}

.top-bar ion-icon {
    font-size: 24px;
}

.content-area {
    padding: 70px 20px 20px;
}

/* Dashboard Card */
.dashboard-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-main);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
}

.text-orange {
    color: var(--text-orange);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    flex: 1;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 20px 15px;
    color: white;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.action-btn:active {
    transform: scale(0.96);
}

.btn-blue {
    background: var(--primary-blue-gradient);
}

.btn-green {
    background: var(--primary-green-gradient);
}

.btn-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-content span {
    font-size: 18px;
    font-weight: 600;
}

.btn-content ion-icon {
    font-size: 36px;
    opacity: 0.5;
}

/* Tabs */
.tabs-header {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    border-bottom: 1px solid #E5E5EA;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    cursor: pointer;
}

.tab-btn.active {
    color: var(--primary-blue);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lists */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.item-left .item-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.item-left .item-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.item-right {
    text-align: right;
}

.item-amount {
    font-size: 18px;
    font-weight: 700;
}

.amount-in {
    color: #FF3B30;
}

.amount-out {
    color: var(--primary-green);
}

.item-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #E5E5EA;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    gap: 4px;
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-item ion-icon {
    font-size: 24px;
}

.nav-item span {
    font-size: 10px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.close-btn {
    background: #F2F2F7;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.select-wrapper select {
    width: 100%;
    padding: 14px;
    border: 1px solid #E5E5EA;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    background: #FAFAFA;
    transition: border-color 0.2s;
    appearance: none;
}

.form-group input:focus,
.select-wrapper select:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: #FFF;
}

.select-wrapper {
    position: relative;
}

.select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.submit-btn:active {
    opacity: 0.8;
}

.submit-btn.btn-green-bg {
    background: var(--primary-green);
}

/* Toast */
.toast {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    transition: top 0.3s, opacity 0.3s;
    opacity: 0;
    z-index: 1000;
}

.toast.show {
    top: 20px;
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 14px;
}