:root {
    --bg: #0f1c17;
    --bg-2: #163028;
    --panel: #1b3a31;
    --text: #e8f2ec;
    --muted: #9bb5a8;
    --accent: #3dbe8c;
    --danger: #e07a5f;
    --border: rgba(232, 242, 236, 0.12);
    --font: "Segoe UI", "PT Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background:
        radial-gradient(1200px 600px at 10% -10%, #1f4b3d 0%, transparent 55%),
        linear-gradient(160deg, var(--bg), #0b1411 60%, #13241d);
    color: var(--text);
    min-height: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px;
    padding: 1.5rem 1rem;
    background: rgba(10, 20, 16, 0.72);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(8px);
}
.brand {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.65rem; }
.sidebar a { color: var(--text); opacity: 0.9; }
.content { flex: 1; padding: 1.5rem; max-width: 1200px; }
.auth-content { max-width: 480px; margin: 0 auto; padding-top: 4rem; }

h1, h2, h3 { margin-top: 0; font-weight: 650; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.panel {
    background: linear-gradient(180deg, rgba(27,58,49,0.9), rgba(16,34,28,0.92));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}
.stat-value { font-size: 1.55rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.9rem; }

.btn, button, .form button {
    background: var(--accent);
    color: #062016;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.95rem;
    font-weight: 650;
    cursor: pointer;
}
.btn.secondary, button.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn.danger { background: var(--danger); color: #1a0c08; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
    width: 100%;
    background: #0d1a15;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
}
label { display: block; margin: 0.7rem 0 0.3rem; color: var(--muted); font-size: 0.9rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin: 0.75rem 0;
    border: 1px solid var(--border);
}
.alert.error { background: rgba(224,122,95,0.15); color: #ffc4b5; }
.alert.warn { background: rgba(230, 190, 90, 0.12); color: #f0de9a; }
.alert.ok { background: rgba(61,190,140,0.12); color: #b8f0d5; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.bar-chart { display: flex; align-items: flex-end; gap: 0.4rem; height: 140px; }
.bar { flex: 1; background: var(--accent); border-radius: 6px 6px 0 0; min-width: 12px; opacity: 0.85; }
.bar-expense { background: var(--danger); }

@media (max-width: 800px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
}

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: #5a2a20; padding: 0.75rem 1rem;
}
