:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --background-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

header p {
    color: var(--text-muted);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.card h2 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.card.highlight .value {
    color: var(--primary-color);
}

.card.secondary .value {
    color: var(--success-color);
}

/* Form Styles */
.forms-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .forms-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.form-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    /* Important for width: 100% */
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* History Section */
.history-section {
    margin-top: 40px;
}

.history-section h3 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

.history-list {
    display: grid;
    gap: 15px;
}

.history-item {
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-left: 4px solid var(--primary-color);
}

.history-item.overspent {
    border-left-color: var(--danger-color);
    background-color: #fef2f2;
}

.history-item.balanced {
    border-left-color: var(--success-color);
}

.history-date {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.history-details {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.history-amount {
    text-align: right;
}

.history-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    display: block;
}

.history-remaining {
    font-size: 0.85rem;
    color: var(--success-color);
}

.history-item.overspent .history-remaining {
    color: var(--danger-color);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

/* History Transaction Details */

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-transactions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.9rem;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--text-color);
}

.transaction-note {
    color: var(--text-muted);
    font-style: italic;
    margin-left: 8px;
}

/* FAB Styles */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover);
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-color);
}

/* Tabs Styles */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}