:root {
    --bg-body: #121212;
    --bg-card: #1E1E1E;
    --bg-input: #2C2C2C;
    --primary: #00E676; 
    --accent-red: #FF5252;
    --text-main: #FFFFFF;
    --text-muted: #B0B0B0;
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px rgba(0, 230, 118, 0.3);
    --radius-xl: 24px;
    --radius-md: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    margin: 0; color: var(--text-main);
    min-height: 100vh;
}

.app-container {
    max-width: 480px; margin: 0 auto;
    background: var(--bg-body); min-height: 100vh;
    padding-bottom: 80px;
}

/* BANNER */
.install-banner {
    position: fixed; top: 0; left: 0; right: 0;
    background: #2d3436; color: white; padding: 12px 20px;
    z-index: 9999; align-items: center; justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: slideDown 0.5s ease;
    display: flex;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

.install-content { display: flex; align-items: center; gap: 15px; }
.install-content div { display: flex; flex-direction: column; }
.install-content strong { font-size: 14px; }
.install-content span { font-size: 11px; opacity: 0.8; }
.btn-install { background: var(--primary); border: none; padding: 6px 15px; border-radius: 20px; color: black; font-weight: bold; cursor: pointer; font-size: 12px; }

/* HEADER */
header {
    background: linear-gradient(180deg, #1a1a1a 0%, #121212 100%);
    padding: 20px 20px 30px 20px; text-align: center;
}
header h1 {
    font-size: 1.1rem; color: var(--text-muted);
    margin: 40px 0 20px 0; text-transform: uppercase;
    letter-spacing: 1px; font-weight: 500;
}

.report-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md); padding: 15px;
    margin-bottom: 20px; border: 1px solid #333;
}
.month-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; font-weight: 600; font-size: 1rem;
}
.month-nav button {
    background: none; border: none; color: var(--primary);
    font-size: 1.2rem; cursor: pointer; padding: 0 10px;
}
.report-summary {
    display: flex; justify-content: space-around;
    border-top: 1px solid #333; padding-top: 12px;
}
.report-item { display: flex; flex-direction: column; align-items: center; }
.report-item small { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 2px; }
.report-item span { font-weight: 600; font-size: 0.95rem; }
.report-item.income span { color: var(--primary); }
.report-item.expense span { color: var(--accent-red); }

.balance-card {
    background: var(--bg-card); padding: 25px;
    border-radius: var(--radius-xl); box-shadow: var(--shadow-soft);
    border: 1px solid #333; position: relative;
    margin-bottom: -10px; text-align: center;
}
.balance-card p { margin: 0; color: var(--text-muted); font-size: 0.8rem; }
.balance-card h2 { margin: 8px 0 0 0; font-size: 2.2rem; color: var(--text-main); font-weight: 700; }

/* INPUT */
.input-section { padding: 20px; }
.tabs { display: flex; background: var(--bg-card); padding: 5px; border-radius: 50px; margin-bottom: 20px; border: 1px solid #333; }
.tab-btn { flex: 1; padding: 12px; border: none; background: transparent; cursor: pointer; font-family: 'Poppins', sans-serif; color: var(--text-muted); border-radius: 50px; transition: 0.3s; font-weight: 500; font-size: 0.9rem; }
.tab-btn.active { background: var(--bg-input); color: var(--text-main); font-weight: 600; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-muted); margin-left: 5px; font-weight: 500; }
input, select {
    width: 100%; padding: 16px; background: var(--bg-input);
    border: 1px solid transparent; border-radius: var(--radius-md);
    color: white; font-size: 1.1rem; font-family: 'Poppins', sans-serif;
    outline: none; transition: 0.2s;
}
input:focus, select:focus { border-color: var(--primary); background: #333; }

.category-input-group { display: flex; gap: 10px; }
#categorySelect { flex: 1; }
#newCategoryInput { flex: 1; border: 1px solid var(--primary); }
#btnAddCategory, #btnDelCategory {
    width: 55px; border-radius: var(--radius-md); font-size: 1.2rem;
    cursor: pointer; border: none; display: flex; align-items: center; justify-content: center;
}
#btnAddCategory { background: var(--bg-input); color: var(--primary); border: 1px solid var(--primary); }
#btnDelCategory { background: rgba(255, 82, 82, 0.15); color: var(--accent-red); }

.save-btn {
    width: 100%; padding: 18px; background: var(--primary); color: #000; border: none;
    border-radius: var(--radius-xl); font-size: 1rem; font-weight: 700;
    cursor: pointer; margin-top: 10px; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: var(--shadow-glow);
}

/* HISTORY LIST */
.history-section { padding: 10px 20px 40px 20px; }
.history-section h3 { font-size: 1.1rem; margin-bottom: 20px; font-weight: 600; }
#transactionList { list-style: none; padding: 0; margin: 0; }

/* Pemisah Tanggal */
.date-separator {
    font-size: 0.85rem; color: var(--text-muted);
    margin: 25px 0 10px 5px; font-weight: 500; opacity: 0.8;
    display: flex; align-items: center;
}
.date-separator::after { content: ''; flex: 1; height: 1px; background: #333; margin-left: 10px; }

/* Item Transaksi */
.transaction-item {
    background: var(--bg-card); padding: 16px; margin-bottom: 12px;
    border-radius: var(--radius-md); display: flex; justify-content: space-between;
    align-items: center; border: 1px solid #333;
}
.trans-info { display: flex; flex-direction: column; justify-content: center; }
.trans-info strong { font-size: 1rem; margin-bottom: 4px; font-weight: 500; color: var(--text-main); }
.trans-info small { color: #666; font-size: 0.75rem; }

.trans-action { display: flex; align-items: center; }
.amount { font-weight: 600; font-size: 1rem; }
.amount.expense { color: var(--accent-red); }
.amount.income { color: var(--primary); }

.del-btn {
    background: none; border: none; color: #555;
    cursor: pointer; font-size: 1.1rem; margin-left: 12px;
    padding: 5px; display: flex; align-items: center; justify-content: center;
}

/* Tombol Edit di sebelah tombol Hapus */
.edit-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; margin-left: 8px; padding: 5px;
    filter: grayscale(1); transition: 0.3s;
}
.edit-btn:hover { filter: none; transform: scale(1.1); }

/* Ringkasan Harian (Di bawah list transaksi hari itu) */
.daily-summary {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 5px 10px 15px 0; /* Memberi jarak sebelum tanggal berikutnya */
    border-bottom: 1px dashed #333; /* Garis putus-putus halus */
    margin-bottom: 15px;
}

.daily-summary span { margin-left: 10px; }
.daily-inc { color: var(--primary); }
.daily-exp { color: var(--accent-red); }