:root {
  --bg: #f7f8f4;
  --panel: #ffffff;
  --border: #dbe4d3;
  --text: #223126;
  --muted: #6b7a6e;
  --accent: #7fa96b;
  --accent-strong: #5a7f4b;
  --danger: #c94b4b;
  --ok: #3d8b5d;
  --warn: #a87700;
  --shadow: 0 10px 30px rgba(40,70,40,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8faf5 0%, #f2f5ee 100%);
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar {
  background: #edf3e8;
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  position: sticky; top: 0; height: 100vh; overflow:auto;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: var(--shadow);
}
.nav { display: grid; gap: 8px; }
.nav a {
  display: block; padding: 12px 14px; border-radius: 12px; color: var(--text); font-weight: 600;
}
.nav a.active, .nav a:hover { background: rgba(127,169,107,.13); text-decoration: none; }
.main { padding: 22px; overflow:auto; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap: 20px; margin-bottom: 20px; }
.topbar h1 { margin: 0; font-size: 30px; }
.userbox, .card, .flash { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.userbox { padding: 10px 14px; }
.grid { display:grid; gap:18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card { padding: 18px; }
.card h2, .card h3 { margin-top: 0; }
.kpi { font-size: 30px; font-weight: 700; margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.flash { padding: 14px 16px; margin-bottom: 18px; }
.flash-success { border-left: 5px solid var(--ok); }
.flash-error { border-left: 5px solid var(--danger); }
.flash-warning { border-left: 5px solid var(--warn); }
.flash-info { border-left: 5px solid var(--accent-strong); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid #edf0e7; text-align: left; vertical-align: top; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.num { text-align: right; white-space: nowrap; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid #ccd8c3; border-radius: 12px; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
button, .button {
  display:inline-block; padding: 11px 16px; border-radius: 12px; border: 0; background: var(--accent-strong); color:#fff; font-weight:700; cursor:pointer;
}
button.secondary, .button.secondary { background: #95a78b; }
button.warn, .button.warn { background: #bb8a11; }
button.danger, .button.danger { background: var(--danger); }
.badge { display:inline-block; padding: 5px 10px; border-radius: 999px; background:#eef4ea; color: var(--accent-strong); font-size: 12px; font-weight: 700; }
.badge.warn { background: #fff4df; color: #a87700; }
.badge.danger { background: #ffe4e4; color: #b13b3b; }
.badge.info { background: #e9f3ff; color: #3f6fa1; }
.login-wrap { min-height: 100vh; display:grid; place-items:center; padding:24px; }
.login-card { width:min(460px, 100%); background: var(--panel); border:1px solid var(--border); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.form-row { display:grid; gap:12px; margin-bottom:14px; }
.notice { padding:12px 14px; border-radius: 12px; background:#f3f8ef; border:1px solid var(--border); }
.actions { display:flex; gap:10px; flex-wrap:wrap; }
.inline-form { display:inline; }
.toolbar { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.table-wrap { overflow:auto; }
.help { font-size: 13px; color: var(--muted); }
.row-income { background: #fcfffb; }
.row-expense { background: #fffdf9; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
@media print {
  .sidebar, .topbar .userbox, .no-print { display:none !important; }
  .shell { display:block; }
  .main { padding:0; }
  .card { border:0; box-shadow:none; padding:0; }
}

.suggestion-list { display:grid; gap:12px; }
.suggestion-card {
  border:1px solid #dfe8d8;
  border-radius:16px;
  padding:12px;
  background:#fbfdf9;
}
.suggestion-top {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
