* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #1e293b;
    --background-color: #f1f5f9;
    --card-background: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --header-bg: #1e293b;
    --header-text: #f8fafc;
    --error-color: #dc2626;
    --error-hover: #b91c1c;
    --tile-hover: #f8fafc;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-primary);
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

    h1 {
        font-size: 1.75rem;
        font-weight: 600;
        letter-spacing: -0.025em;
    }

    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1280px;
        margin: 0 auto;
        padding: 0 1rem;

        .balance-display {
            display: flex;
            align-items: center;
            margin-left: auto;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);

            .balance-divider {
                width: 1px;
                height: 24px;
                background: rgba(255, 255, 255, 0.1);
                margin: 0 0.25rem;
            }

            .balance-item {
                display: flex;
                align-items: center;
                gap: 0.75rem;
                padding: 0.5rem 0.75rem;
                border-radius: 6px;
                transition: all 0.2s ease-in-out;
                min-width: 140px;

                &:hover {
                    background: rgba(255, 255, 255, 0.1);
                }

                .balance-info {
                    display: flex;
                    flex-direction: column;
                    gap: 0.125rem;

                    .balance-label {
                        font-size: 0.75rem;
                        color: rgba(255, 255, 255, 0.7);
                        font-weight: 500;
                        text-transform: uppercase;
                        letter-spacing: 0.025em;
                    }

                    .balance-amount {
                        font-size: 0.875rem;
                        font-weight: 600;
                        color: var(--header-text);
                    }
                }
            }
        }
    }
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;

    .action-tile {
        background-color: var(--card-background);
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease-in-out;
        border: none;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        aspect-ratio: 1 / 1;

        &:hover {
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
            transform: translateY(-4px);
        }

        &:active {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        h2 {
            font-size: 1.25rem;
            color: var(--text-primary);
            font-weight: 600;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin-bottom: 1rem;

            label {
                font-weight: 500;
                color: var(--text-secondary);
                font-size: 0.875rem;
            }

            input,
            select {
                padding: 0.75rem 1rem;
                border: 1px solid var(--border-color);
                border-radius: 8px;
                font-size: 1rem;
                color: var(--text-primary);
                background-color: var(--card-background);
                transition: all 0.2s ease-in-out;

                &:focus {
                    outline: none;
                    border-color: var(--primary-color);
                    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
                }

                &:hover {
                    border-color: var(--primary-color);
                }
            }
        }

        .pending-amount {
            background: rgba(59, 130, 246, 0.1);
            padding: 1rem;
            border-radius: 8px;
            text-align: center;

            .amount-label {
                font-size: 0.875rem;
                color: var(--text-secondary);
                margin-bottom: 0.5rem;
            }

            .amount-value {
                font-size: 2rem;
                font-weight: 600;
                color: var(--primary-color);
            }
        }

        .submit-btn {
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 0.75rem 1.5rem;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease-in-out;
            opacity: 0.9;
            margin-top: auto;

            &:hover {
                background-color: var(--primary-hover);
                opacity: 1;
                transform: translateY(-2px);
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            }

            &:active {
                transform: translateY(0);
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            }
        }
    }
}

.history-section {
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
    border: none;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: auto;
    max-height: calc(100vw / 3);
    margin-top: 1.5rem;

    &:hover {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        transform: translateY(-4px);
    }

    &:active {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    h2 {
        font-size: 1.25rem;
        color: var(--text-primary);
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    .history-list {
        list-style: none;
        overflow-y: auto;
        flex: 1;
        padding-right: 0.5rem;
        margin-right: -0.5rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;

        &::-webkit-scrollbar {
            width: 6px;
        }

        &::-webkit-scrollbar-track {
            background: transparent;
            margin: 0.5rem;
        }

        &::-webkit-scrollbar-thumb {
            background-color: rgba(0, 0, 0, 0.1);
            border-radius: 3px;

            &:hover {
                background-color: rgba(0, 0, 0, 0.2);
            }
        }

        .history-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            background-color: var(--card-background);
            border-radius: 8px;
            transition: all 0.2s ease-in-out;
            border: none;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

            .transaction-type {
                font-weight: 500;
                color: var(--text-primary);
            }

            .transaction-details {
                color: var(--text-secondary);
                font-size: 0.875rem;
            }

            .amount {
                &.amount-positive {
                    color: var(--success-color);
                    font-weight: 500;
                }

                &.amount-negative {
                    color: var(--error-color);
                    font-weight: 500;
                }
            }

            &:last-child {
                margin-bottom: 0;
            }

            &:hover {
                background-color: var(--tile-hover);
                box-shadow: 0 4px 6px var(--shadow-color);
                transform: translateY(-2px);
            }

            &:active {
                transform: translateY(0);
                box-shadow: 0 2px 4px var(--shadow-color);
            }
        }
    }
}