:root {
    --primary-color: #10B981;
    /* Emerald 500 */
    --primary-dark: #059669;
    /* Emerald 600 */
    --bg-color: #F3F4F6;
    /* Gray 100 */
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    /* Gray 800 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --danger-color: #EF4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-lg: 16px;
    --radius-md: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 40px;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 24px;
    text-align: center;
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.total-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: left;
}

.total-card .label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.total-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 8px 0;
}

/* Forms & Inputs */
main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hidden-tab {
    display: none;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #D1D5DB;
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: #FAFAFA;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #F0FDF4;
}

.upload-area .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

#preview-container {
    margin-top: 20px;
}

#receipt-preview {
    width: 100%;
    border-radius: var(--radius-md);
    max-height: 300px;
    object-fit: cover;
}

/* List */
.expense-list {
    list-style: none;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #E5E7EB;
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-info h4 {
    font-size: 1rem;
    font-weight: 600;
}

.expense-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.expense-amount {
    font-weight: 700;
    color: var(--primary-dark);
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-left: 12px;
    cursor: pointer;
}

.delete-btn:hover {
    color: var(--danger-color);
}

/* Category List */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #E5E7EB;
}

.category-name {
    font-weight: 600;
    color: var(--text-main);
}

.category-amount {
    font-weight: 700;
    color: var(--primary-dark);
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: white;
}

/* Views & Nav */
.view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 60px;
    /* Space for bottom nav */
}

.hidden-view {
    display: none;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    padding: 10px;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    cursor: pointer;
    flex: 1;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Category List */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #E5E7EB;
}

.category-name {
    font-weight: 600;
    color: var(--text-main);
}

.category-amount {
    font-weight: 700;
    color: var(--primary-dark);
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: white;
}