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

/* ── Base ──────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0d0d0d;
    color: #d4d4d4;
    min-height: 100vh;
}

h1, h2, h3 { color: #e8e8e8; }
p { color: #aaa; }
strong { color: #d4d4d4; }

/* ── Nav ───────────────────────────────────────────────────── */
nav {
    background: #111;
    border-bottom: 1px solid #1e1e1e;
    padding: 15px 20px;
}
nav .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
nav h1 { font-size: 24px; color: #e8e8e8; }
nav .nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
nav a {
    color: #aaa;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
nav a:hover { background: #1a1a1a; color: #2ecc71; }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: #111;
    border: 1px solid #1e1e1e;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.card h2 { color: #e8e8e8; margin-bottom: 20px; }

/* ── Dashboard grid ────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat {
    font-size: 36px;
    font-weight: bold;
    color: #2ecc71;
    margin: 10px 0;
}
.stat-label { color: #666; font-size: 14px; }

/* ── List items ────────────────────────────────────────────── */
.list-item {
    padding: 12px;
    background: #161616;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #2ecc71;
    color: #d4d4d4;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.form-group { display: flex; flex-direction: column; }
label { margin-bottom: 5px; color: #999; font-weight: 500; font-size: 0.9rem; }

input, select, textarea {
    padding: 10px 12px;
    background: #161616;
    border: 1px solid #252525;
    border-radius: 6px;
    color: #d4d4d4;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2ecc71;
}
select option { background: #161616; }

/* ── Buttons ───────────────────────────────────────────────── */
button, .btn {
    padding: 10px 22px;
    background: #162d1e;
    color: #2ecc71;
    border: 1px solid #2a5c3a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    text-decoration: none;
    display: inline-block;
}
button:hover, .btn:hover {
    background: #1e4028;
    border-color: #2ecc71;
    transform: translateY(-1px);
}

.delete-btn {
    background: #2d1010;
    color: #ff7878;
    border: 1px solid #5c2a2a;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}
.delete-btn:hover { background: #3d1414; }

.toggle-btn {
    background: #0d2d1a;
    color: #5df59a;
    border: 1px solid #1e6e3e;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.toggle-btn:hover { background: #162d1e; }

/* ── Tables ────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #1a1a1a; }
th { background: #141414; color: #888; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #141414; }

/* ── Empty states ──────────────────────────────────────────── */
.empty-state { text-align: center; color: #555; padding: 40px; }

/* ── Alerts ────────────────────────────────────────────────── */
.error   { background: #2d1010; color: #ff7878; border: 1px solid #5c2a2a; padding: 10px 14px; border-radius: 6px; margin-bottom: 20px; }
.success { background: #0d2d1a; color: #5df59a; border: 1px solid #1e6e3e; padding: 10px 14px; border-radius: 6px; margin-bottom: 20px; }

/* ── Goals ─────────────────────────────────────────────────── */
.goal-item {
    background: #141414;
    border: 1px solid #1e1e1e;
    border-left: 3px solid #2ecc71;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}
.goal-item.completed { opacity: 0.55; border-left-color: #1e6e3e; }
.goal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.goal-actions { display: flex; gap: 10px; }

/* ── Settings / Danger zone ────────────────────────────────── */
.danger-zone {
    border: 1px solid #5c2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
}
.danger-zone h3 { color: #ff7878; margin-bottom: 15px; }
.btn-danger {
    background: #2d1010;
    color: #ff7878;
    border: 1px solid #5c2a2a;
}
.btn-danger:hover { background: #3d1414; border-color: #ff7878; }

/* ── Budget summary cards ──────────────────────────────────── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.summary-card {
    background: #111;
    border: 1px solid #1e1e1e;
    padding: 25px;
    border-radius: 12px;
}
.summary-card h3 { color: #666; font-size: 13px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.summary-card .amount { font-size: 32px; font-weight: bold; color: #2ecc71; }
.summary-card.debt   .amount { color: #ff7878; }
.summary-card.income .amount { color: #5df59a; }

.edit-btn {
    background: #1a1a10;
    color: #f0c060;
    border: 1px solid #4a3a10;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}
.edit-btn:hover { background: #252510; }

.actions { display: flex; gap: 5px; }

/* ── Login page ────────────────────────────────────────────── */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.login-container {
    background: #111;
    border: 1px solid #1e1e1e;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    width: 100%;
    max-width: 400px;
}
.login-container h1 { text-align: center; margin-bottom: 30px; color: #e8e8e8; }
.login-container input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}
.login-container button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    justify-content: center;
}
.toggle-link { text-align: center; margin-top: 20px; color: #666; }
.toggle-link a { color: #2ecc71; font-weight: 600; text-decoration: none; }
.toggle-link a:hover { color: #5df59a; }
