:root {
  --bg: #F5F6FF;
  --panel: #FFFFFF;
  --text: #2A2A2E;
  --muted: #7B7F90;
  --line: #E7E8F3;
  --accent: #7C5CFF;
  --accent-2: #B07CFF;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(38, 33, 88, .08);
}
* { box-sizing: border-box; }
html, body { height:100%; }
body {
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans';
  color:var(--text);
  background: radial-gradient(800px 400px at 10% -20%, #F1EEFF 0%, #F5F6FF 50%, #F5F6FF 100%);
}
.wrap { max-width: 1160px; margin: 12px auto 96px; padding: 0 12px; }
header { display:grid; grid-template-columns: 1fr auto; gap:10px; align-items:center; margin-bottom: 8px; }
header .left { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
h1 { font-size: 18px; margin: 0; letter-spacing:0.2px; font-weight:800; color:#2D2B63; }
label { font-size: 12px; color: var(--muted); }
input[type="month"], input[type="text"], select {
  background: #F8F8FF; color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 12px; outline: none; box-shadow: var(--shadow);
  transition: border-color .15s, background .15s;
}
input[type="month"]:focus, input[type="text"]:focus, select:focus { border-color: #C9B7FF; background:#FFFFFF; }
input.amount { text-align:right; font-variant-numeric: tabular-nums; font-weight:600; letter-spacing:.2px; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border:1px solid #D6CCFF; color:white;
  padding:8px 12px; border-radius:999px; cursor:pointer; box-shadow: var(--shadow);
  transition: filter .15s ease;
  font-size: 14px;
}
.btn:hover { filter: brightness(1.05); }
.btn.icon { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; }
.btn.ghost { background:#FFFFFF; color:#4B4E68; border:1px solid var(--line); }
.btn.ghost:hover { background:#F8F8FF; }
.btn.danger { background:#FFE6EA; color:#A62434; border-color:#FFD4DB; }

.panel { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 10px; box-shadow: var(--shadow); }
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
@media (max-width: 980px){ .grid-2 { grid-template-columns: 1fr; } }

.section-header { display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content: space-between; margin-bottom: 6px; }
.section-header h2 { font-size:15px; margin:0; font-weight:800; color:#3B3A8A; }
.section-header .income { display:flex; gap:8px; align-items:center; }

table { width:100%; border-collapse: collapse; }
th, td { border-bottom: 1px dashed var(--line); padding: 8px 6px; vertical-align: middle; }
th { color: var(--muted); font-weight: 700; text-align:left; font-size: 11px; text-transform: uppercase; letter-spacing:.3px; }
tr:hover td { background: #FAFAFF; }
td input[type="text"] { width:100%; }
td input.amount { width:120px; }
td .center { text-align:center; }
.drag-handle { cursor:grab; user-select:none; opacity: .9; padding: 2px 6px; border:1px dashed #D9D7FF; border-radius:8px; font-size:12px; color:#6E6BB5; background:#F6F5FF; }

.add-line { margin-top: 8px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.bulk { margin-left: auto; display:flex; gap:8px; }
.totals { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; margin-top: 10px; font-size: 13px; }
.totals .badge { background:#FFFFFF; border:1px solid var(--line); padding:6px 10px; border-radius: 999px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }

footer { position:fixed; left:0; right:0; bottom:0; padding:6px 12px; }
.hint { color: var(--muted); font-size: 12px; }

.kpi { display:flex; gap:8px; flex-wrap:wrap; }
.kpi .card { flex:1; min-width: 140px; background:#FFFFFF; border:1px solid var(--line); border-radius:12px; padding:10px 12px; box-shadow: var(--shadow); }
.kpi .label { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.3px; }
.kpi .value { font-size:16px; font-weight:800; letter-spacing:.2px; color:#3B3A8A; }
.bar { height:10px; background:#F4F5FF; border:1px solid var(--line); border-radius:999px; overflow:hidden; }
.bar > div { height:100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width:0%; transition:width .15s; }
