:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --input-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --accent: #818cf8;
    --danger: #f43f5e;
    --danger-glow: rgba(244, 63, 94, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --success: #10b981;
    --success-hover: #059669;
    --font-family: 'Plus Jakarta Sans', sans-serif;
    --border-radius: 12px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.85rem;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 85% 85%, rgba(129, 140, 248, 0.08) 0%, transparent 40%);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-out;
    display: flex;
    gap: 24px;
}

.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    text-align: left;
    margin-bottom: 14px;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}
.reminder-banner {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.reminder-banner.warning {
    background: var(--warning-glow);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.reminder-banner.danger {
    background: var(--danger-glow);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.summary-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.total-card {
    background: linear-gradient(135deg, #4f46e5, #0284c7);
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
    text-align: center;
    transition: all 0.3s ease;
}

.total-card.exceeded {
    background: linear-gradient(135deg, #e11d48, #9f1239);
    box-shadow: 0 10px 20px rgba(225, 29, 72, 0.3);
}

.total-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    margin-bottom: 4px;
}

.total-card p {
    font-size: 1.8rem;
    font-weight: 700;
}

.stats-row {
    display: flex;
    gap: 10px;
}

.stat-card {
    flex: 1;
    background: var(--input-bg);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.stat-card strong {
    font-size: 0.95rem;
    margin-top: 2px;
}

.budget-container, .form-container {
    margin-top: 14px;
}

.budget-input-row {
    display: flex;
    gap: 6px;
}

.budget-input-row input {
    flex: 1;
}

.btn-primary {
    padding: 0 14px;
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius);
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #0284c7;
    color: #fff;
}

.btn-secondary {
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.list-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row .input-group {
    flex: 1;
}

label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

input, select {
    width: 100%;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: var(--font-family);
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

button#add-btn {
    width: 100%;
    padding: 12px;
    background: var(--success);
    border: none;
    border-radius: var(--border-radius);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 2px;
}

button#add-btn:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#clear-all-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

#clear-all-btn:hover {
    color: var(--danger);
}

.filter-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: #0f172a;
    font-weight: 600;
}

ul#expense-list {
    list-style: none;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

ul#expense-list::-webkit-scrollbar {
    width: 4px;
}

ul#expense-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--input-bg);
    padding: 10px 12px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    border-left: 3px solid var(--primary);
    animation: slideIn 0.25s ease-out;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.expense-item:hover {
    transform: translateX(2px);
}

.expense-item.food { border-color: #f43f5e; }
.expense-item.transport { border-color: #38bdf8; }
.expense-item.shopping { border-color: #a855f7; }
.expense-item.bills { border-color: #f59e0b; }
.expense-item.other { border-color: #64748b; }

.item-left {
    display: flex;
    flex-direction: column;
}

.item-left .title {
    font-size: 0.85rem;
    font-weight: 600;
}

.item-left .category {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-right .amount {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--danger);
}

.delete-btn {
    background: var(--danger-glow);
    color: var(--danger);
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: var(--danger);
    color: #fff;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 18px;
        padding: 18px;
    }

    .right-panel {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-left: 0;
        padding-top: 18px;
    }

    ul#expense-list {
        max-height: 200px;
    }
}

@media (max-width: 400px) {
    .input-row {
        flex-direction: column;
        gap: 0;
    }
}