:root {
    --bg: #000000;
    --surface: #0a0a0a;
    --border: #262626;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent: #ffffff;
    --success: #ffffff; /* Staying B&W, but maybe bold? */
    --danger: #ffffff;
    --income-color: #ffffff;
    --expense-color: #a3a3a3;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    padding: 4rem 1rem; /* More top/bottom padding */
    line-height: 1.5;
    overflow: hidden; 
}

.container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
header {
    margin-bottom: 3rem; /* Reduced from 3rem */
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

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

.logo-icon {
    font-size: 1rem;
}

.logo h1 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.balance-card p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.balance-card h2 {
    font-size: 2.25rem; /* Reduced from 3rem */
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-icon {
    display: none; /* Minimalist: hide icons */
}

.stat-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* BUG #18: Stat Inversion (Inverted colors) */


/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.875rem 1rem;
    color: white;
    outline: none;
    font-size: 0.9rem;
}

.search-bar input:focus {
    border-color: var(--accent);
}

.btn-add {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    font-size: 0.8rem;
    transition: opacity 0.2s;
    /* BUG #13: Click through button */
}

.btn-add:hover {
    opacity: 0.9;
}

/* Transaction List */
.transaction-section {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.filter-btns {
    display: flex;
    gap: 1rem;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.filter-btn.active {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.transaction-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 5px;
}

.transaction-list::-webkit-scrollbar {
    width: 2px;
}

.transaction-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.transaction-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.item-icon {
    font-size: 1.25rem;
    opacity: 0.7;
}

.item-details p {
    font-weight: 500;
    font-size: 0.95rem;
}

.item-details span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.item-amount {
    font-weight: 600;
    font-size: 0.95rem;
}

.amount-income { color: var(--text-primary); }
.amount-expense { color: var(--text-secondary); }

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.5rem;
    opacity: 0.4;
}

.delete-btn:hover {
    opacity: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 400px;
    padding: 2.5rem;
    /* BUG #2: Overriding visibility logic */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.modal-header h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.75rem;
    color: white;
    outline: none;
}

/* BUG #16: Invisible Dropdown Options */
.form-group select option {
    background: #ffffff;
    color: #0f172a;
}

.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.radio-label {
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.custom-radio {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: var(--surface);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.radio-label input:checked + .custom-radio {
    background: var(--accent);
    color: var(--bg);
}

.btn-submit {
    width: 100%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    margin-top: 1rem;
}
