* { box-sizing: border-box; }

:root {
    --green-dark: #2f4a24;
    --green: #3d5a2f;
    --green-light: #6c9a3f;
    --green-pale: #eaf3e1;
    --jona: #4a7c59;
    --mike: #d4914d;
    --bg: #f2f5ee;
    --text: #262b23;
    --muted: #6b7568;
    --radius: 14px;
    --shadow: 0 4px 14px rgba(45, 63, 33, 0.08);
    --shadow-hover: 0 8px 22px rgba(45, 63, 33, 0.14);
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3 { font-family: 'Poppins', 'Segoe UI', sans-serif; color: var(--green-dark); }
h1 { font-size: 1.9rem; margin: 0; }
h2 { font-size: 1.3rem; margin: 0 0 16px; }

/* Hero banner */
.hero {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(120deg, var(--green-dark), var(--green-light));
    color: #fff;
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
}
.hero h1 { color: #fff; }
.hero-emoji { font-size: 3rem; line-height: 1; }
.hero-subtitle { margin: 6px 0 0; color: rgba(255,255,255,0.85); font-size: 0.98rem; }

/* Navbar */
.navbar {
    background: linear-gradient(120deg, var(--green-dark), var(--green));
    color: #fff;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 10;
}
.navbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    text-decoration: none;
}
.brand-logo { height: 42px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }
.navbar .links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin-left: 22px;
    font-weight: 500;
    padding: 8px 4px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.navbar .links a:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.navbar .links a.active { color: #fff; border-color: #f2c94c; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Dashboard cards */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}
.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--green-light);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    animation: fadeInUp 0.35s ease both;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card-icon { font-size: 1.6rem; position: absolute; top: 18px; right: 20px; opacity: 0.85; }
.card h3 { margin: 0 0 10px; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-family: 'Inter', sans-serif; font-weight: 600; }
.card .value { font-size: 1.7rem; font-weight: 700; color: var(--green-dark); }
.accent-total { border-top-color: var(--green); }
.accent-jona { border-top-color: var(--jona); }
.accent-mike { border-top-color: var(--mike); }
.accent-count { border-top-color: #8a8f86; }
.accent-income { border-top-color: #2f8fd4; }
.accent-profit { border-top-color: #2c8a3d; }
.accent-loss { border-top-color: #c0392b; }

/* Bar chart */
.bar-chart { background: #fff; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 32px; }
.bar-row { display: flex; align-items: center; margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { width: 90px; font-weight: 600; }
.bar-track { flex: 1; background: var(--green-pale); border-radius: 20px; overflow: hidden; height: 20px; margin-right: 12px; }
.bar-fill { height: 100%; border-radius: 20px; transition: width 0.4s ease; }
.bar-jona { background: linear-gradient(90deg, var(--jona), #6ba57c); }
.bar-mike { background: linear-gradient(90deg, var(--mike), #e6b578); }
.bar-value { width: 90px; text-align: right; font-weight: 600; }

/* Tables */
.table-wrap {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #eef1ea; }
th { background: var(--green-dark); color: #fff; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.4px; }
tbody tr:nth-child(even) { background: #fafcf7; }
tbody tr:hover { background: var(--green-pale); }
td { color: var(--text); }

.actions { white-space: nowrap; }
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    margin-right: 6px;
    transition: opacity 0.15s ease;
}
.badge:hover { opacity: 0.8; }
.badge-edit { background: var(--green-pale); color: var(--green-dark); }
.badge-delete { background: #fbeaea; color: #a12626; }
.badge-opex { background: #e8f1fb; color: #2f6fa8; }
.badge-capex { background: #fdf0e2; color: #b5691a; }
.badge-recurring { background: #f1e9fb; color: #6c3fae; margin-left: 6px; }

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.list-header h2 { margin: 0; }
.filter-form { display: flex; align-items: center; gap: 8px; }
.filter-form label { font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.filter-form select {
    padding: 8px 10px;
    border: 1.5px solid #dce3d4;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
}

/* Buttons */
.btn {
    display: inline-block;
    background: linear-gradient(120deg, var(--green), var(--green-light));
    color: #fff;
    padding: 11px 20px;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(61, 90, 47, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(61, 90, 47, 0.32); }
.btn-cancel {
    display: inline-block;
    margin-left: 10px;
    padding: 11px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    color: var(--muted);
    background: #eef1ea;
}
.btn-cancel:hover { background: #e3e7dc; }

/* Profit & Loss table */
.pl-table { width: 100%; border-collapse: collapse; }
.pl-table td { padding: 10px 4px; font-size: 1rem; border-bottom: 1px solid #eef1ea; }
.pl-table .pl-amount { text-align: right; font-weight: 600; }
.pl-table .pl-total td { border-top: 2px solid var(--green-dark); border-bottom: none; font-weight: 700; font-size: 1.15rem; padding-top: 14px; }
.pl-positive .pl-amount { color: #2c8a3d; }
.pl-negative .pl-amount { color: #c0392b; }
td.pl-positive { color: #2c8a3d; font-weight: 600; }
td.pl-negative { color: #c0392b; font-weight: 600; }
.section-note { color: var(--muted); font-size: 0.88rem; margin: -6px 0 16px; }

/* Forms */
form.form-card {
    background: #fff;
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 640px;
    margin-bottom: 32px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px 20px;
}
.form-group { margin-bottom: 18px; }
.form-grid .form-group { margin-bottom: 0; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; color: var(--green-dark); }
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #dce3d4;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px rgba(108, 154, 63, 0.18);
}

.alert { padding: 13px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; }
.alert-error { background: #fbeaea; color: #a12626; }
.alert-success { background: #eaf7e6; color: #2c6b1f; }

.empty-state { text-align: center; padding: 30px 16px !important; color: var(--muted); font-style: italic; }

/* Insights */
.insight-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.insight-card {
    display: flex;
    gap: 14px;
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid #8a8f86;
}
.insight-card h3 { margin: 0 0 6px; font-size: 1rem; }
.insight-card p { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--text); }
.insight-icon { font-size: 1.6rem; line-height: 1; }
.insight-good { border-left-color: #2c8a3d; }
.insight-warning { border-left-color: #c0392b; }
.insight-neutral { border-left-color: #2f8fd4; }

@media (max-width: 640px) {
    .navbar { flex-direction: column; gap: 10px; padding: 14px 18px; }
    .navbar .links a { margin: 0 10px; }
    .hero { flex-direction: column; text-align: center; padding: 24px; }
}
