/* 
 * Professional Style for Budget Tracker
 */

:root {
    --primary: #059669;
    /* Emerald Green for Finance */
    --primary-hover: #047857;
    --secondary: #3b82f6;
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --sidebar: #1f2937;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --income: #10b981;
    --expense: #ef4444;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--sidebar);
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

.sidebar nav li.active {
    background-color: var(--primary);
}

.sidebar nav li:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.balance-card {
    background: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.balance-card span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.balance-card strong {
    font-size: 1.25rem;
    color: var(--primary);
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

input,
select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Insights */
.insight-block {
    margin-bottom: 1.5rem;
}

.insight-block h4 {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
}

/* Bucket List Mini */
.bucket-list-mini {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.bucket-item {
    background: var(--bg-main);
    padding: 0.75rem;
    border-radius: 6px;
}

.bucket-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--secondary);
    transition: width 0.3s;
}

/* List Table */
.list-section {
    grid-column: 1 / 3;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.amount-income {
    color: var(--income);
    font-weight: 600;
    text-align: right;
}

.amount-expense {
    color: var(--expense);
    font-weight: 600;
    text-align: right;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    width: 350px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--expense);
    cursor: pointer;
    font-size: 1.2rem;
}