/* Reset and Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--primary-color: #2563eb;
	--primary-hover: #1d4ed8;
	--secondary-color: #64748b;
	--background: #f8fafc;
	--surface: #ffffff;
	--text-primary: #1e293b;
	--text-secondary: #64748b;
	--border-color: #e2e8f0;
	--border-radius: 8px;
	--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	--spacing-xs: 0.5rem;
	--spacing-sm: 0.75rem;
	--spacing-md: 1rem;
	--spacing-lg: 1.5rem;
	--spacing-xl: 2rem;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.6;
	color: var(--text-primary);
	background-color: var(--background);
	padding: var(--spacing-md);
}

/* Header */
header {
	text-align: center;
	margin-bottom: var(--spacing-xl);
}

header h1 {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--text-primary);
}

/* Expenses Section */
#expenses-section {
	background: var(--surface);
	border-radius: var(--border-radius);
	padding: var(--spacing-lg);
	margin-bottom: var(--spacing-xl);
	box-shadow: var(--shadow-sm);
}

#expenses-section h2 {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: var(--spacing-md);
	color: var(--text-primary);
}

#expenses-section h2 span {
	color: var(--primary-color);
	font-weight: 700;
}

/* Table Styles - Mobile First */
#expenses-section {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

#expenses-table {
	width: 100%;
	min-width: 600px;
	border-collapse: collapse;
	font-size: 0.875rem;
}

#expenses-table thead th {
	text-align: left;
	padding: var(--spacing-sm) var(--spacing-md);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--text-secondary);
	border-bottom: 2px solid var(--border-color);
	white-space: nowrap;
}

#expenses-table tbody tr {
	border-bottom: 1px solid var(--border-color);
}

#expenses-table tbody tr:last-child {
	border-bottom: none;
}

#expenses-table tbody td {
	padding: var(--spacing-sm) var(--spacing-md);
	white-space: nowrap;
}

#expenses-table tbody tr:hover {
	background: var(--background);
}

/* Main Section */
main {
	max-width: 100%;
}

#new-expense-section {
	background: var(--surface);
	border-radius: var(--border-radius);
	padding: var(--spacing-lg);
	box-shadow: var(--shadow-sm);
}

#new-expense-section h2 {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: var(--spacing-lg);
	color: var(--text-primary);
}

/* Form Styles */
#new-expense-form {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
}

#new-expense-form > div {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xs);
}

#new-expense-form label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-primary);
}

#new-expense-form input[type="date"],
#new-expense-form input[type="text"],
#new-expense-form select {
	width: 100%;
	padding: var(--spacing-sm) var(--spacing-md);
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	font-size: 1rem;
	font-family: inherit;
	color: var(--text-primary);
	background: var(--surface);
	transition: border-color 0.2s, box-shadow 0.2s;
}

#new-expense-form input[type="date"]:focus,
#new-expense-form input[type="text"]:focus,
#new-expense-form select:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

#new-expense-form button[type="submit"] {
	padding: var(--spacing-md) var(--spacing-lg);
	background: var(--primary-color);
	color: white;
	border: none;
	border-radius: var(--border-radius);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s, transform 0.1s;
	margin-top: var(--spacing-sm);
}

#new-expense-form button[type="submit"]:hover {
	background: var(--primary-hover);
}

#new-expense-form button[type="submit"]:active {
	transform: scale(0.98);
}

.hidden {
	display: none;
}

/* Tablet and Up */
@media (min-width: 768px) {
	body {
		max-width: 1200px;
		margin: 0 auto;
		padding: var(--spacing-xl);
	}

	header h1 {
		font-size: 2rem;
	}

	#expenses-section {
		padding: var(--spacing-xl);
	}

	#expenses-section h2 {
		font-size: 1.5rem;
	}

	#expenses-table {
		min-width: auto;
	}

	#new-expense-section {
		padding: var(--spacing-xl);
	}

	#new-expense-section h2 {
		font-size: 1.5rem;
	}

	#new-expense-form {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--spacing-md);
	}

	#new-expense-form > div.notes,
	#new-expense-form > button[type="submit"] {
		grid-column: 1 / -1;
	}

	#new-expense-form button[type="submit"] {
		justify-self: start;
		min-width: 150px;
	}
}

/* Desktop */
@media (min-width: 1024px) {
	body {
		padding: var(--spacing-xl) var(--spacing-xl);
	}

	#expenses-section,
	#new-expense-section {
		box-shadow: var(--shadow-md);
	}

	#expenses-table {
		font-size: 1rem;
	}

	#expenses-table thead th {
		font-size: 0.9375rem;
		padding: var(--spacing-md);
	}

	#expenses-table tbody td {
		padding: var(--spacing-md);
	}
}

