:root {
  --bg: #0b0e14;
  --surface: #151a24;
  --card: #1a2030;
  --card2: #212839;
  --line: #2a3346;
  --text: #eceff5;
  --muted: #98a2b6;
  --faint: #6b7489;
  --gold: #d6a84a;
  --gold-ink: #1d1606;
  --inc: #20a88e;
  --exp: #d4775c;
  --good: #3fbf7f;
  --warn: #e3b341;
  --bad: #ef6a5b;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  min-height: 100dvh; overscroll-behavior-y: none; -webkit-user-select: none; user-select: none;
}
input, textarea, select { -webkit-user-select: text; user-select: text; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .amt { font-variant-numeric: tabular-nums; }
a { color: var(--gold); }
#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + var(--safe-b)); }

/* ---------- Κάλυμμα ιδιωτικότητας ---------- */
#veil { position: fixed; inset: 0; z-index: 999; background: var(--bg); display: none; align-items: center; justify-content: center; }
body.veil #veil { display: flex; }
#veil .mark { width: 64px; height: 64px; opacity: .5; }
body.hide-amt .amt { color: transparent !important; text-shadow: 0 0 10px rgba(236, 239, 245, .55); }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; gap: 8px; padding: calc(14px + env(safe-area-inset-top, 0px)) 0 10px; position: sticky; top: 0; background: linear-gradient(var(--bg) 75%, transparent); z-index: 5; }
.top h1 { font-size: 20px; margin: 0; flex: 1; font-weight: 650; letter-spacing: .2px; }
.top .back { margin-left: -8px; }
.ibtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.ibtn:active { background: var(--card); }
.ibtn svg { width: 22px; height: 22px; }

/* ---------- Κάρτες ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 12px 0; border: 1px solid rgba(255,255,255,.03); }
.card.tap { cursor: pointer; }
.card.tap:active { background: var(--card2); }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h2 .sp { flex: 1; }
.card h2 .lnk { text-transform: none; letter-spacing: 0; color: var(--gold); font-weight: 500; font-size: 13px; }
.hero { background: radial-gradient(120% 120% at 100% 0%, #2a2414 0%, var(--card) 55%); border: 1px solid #3a321c; }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.sub { color: var(--muted); font-size: 13px; }
.up { color: var(--good); } .down { color: var(--bad); }
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; min-width: 0; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trio > div { background: var(--surface); border-radius: 12px; padding: 10px; min-width: 0; }
.trio .k { font-size: 12px; color: var(--muted); }
.trio .v { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.accs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.acc { background: var(--card); border-radius: 14px; padding: 12px; cursor: pointer; min-width: 0; }
.acc:active { background: var(--card2); }
.acc .n { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .v { font-weight: 650; font-size: 17px; margin-top: 2px; }
.acc.debt .v { color: var(--bad); }

.bar { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--gold); }

/* ---------- Ειδοποιήσεις ---------- */
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #2a2316; border: 1px solid #4a3c1a; margin: 10px 0; font-size: 14px; }
.alert.bad { background: #2c1a19; border-color: #5a2a26; }
.alert.info { background: #172330; border-color: #24405a; }
.alert .t { flex: 1; }
.alert button { flex: none; }

/* ---------- Λίστες ---------- */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; margin: 12px 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 56px; }
.li:last-child { border-bottom: 0; }
.li:active { background: var(--card2); }
.li .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; font-size: 18px; flex: none; }
.li .t { flex: 1; min-width: 0; }
.li .t .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t .b { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .v { font-weight: 600; text-align: right; white-space: nowrap; }
.li .v.inc { color: var(--inc); }
.li .chev { color: var(--faint); }
.dayh { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; padding: 14px 4px 4px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* ---------- Κουμπιά ---------- */
.btn { border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 600; cursor: pointer; background: var(--card2); color: var(--text); min-height: 48px; }
.btn:active { filter: brightness(1.15); }
.btn.pri { background: var(--gold); color: var(--gold-ink); }
.btn.dan { background: #3a1d1b; color: #ff9b8f; }
.btn.sm { padding: 8px 12px; min-height: 36px; border-radius: 10px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; }
.btns { display: flex; gap: 10px; margin-top: 16px; }
.btns .btn { flex: 1; }

/* ---------- Κάτω μπάρα ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(15, 19, 27, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.nav .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 64px; }
.nav button { border: 0; background: none; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; cursor: pointer; padding: 6px 0; }
.nav button svg { width: 23px; height: 23px; }
.nav button.on { color: var(--gold); }
.nav .fab { width: 54px; height: 54px; border-radius: 18px; background: var(--gold); color: var(--gold-ink); margin: -18px auto 0; display: grid; place-items: center; box-shadow: 0 6px 22px rgba(214, 168, 74, .35); }
.nav .fab svg { width: 28px; height: 28px; }

/* ---------- Φύλλα (bottom sheets) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; animation: fade .15s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface); border-radius: 22px 22px 0 0; max-height: 92dvh; overflow-y: auto; padding: 8px 16px calc(20px + var(--safe-b)); animation: up .2s cubic-bezier(.2, .9, .3, 1); max-width: 560px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.qgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qbtn { background: var(--card); border: 0; border-radius: 16px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; text-align: center; min-height: 86px; }
.qbtn:active { background: var(--card2); }
.qbtn .e { font-size: 26px; line-height: 1; }
.qbtn.hl { background: #2a2414; border: 1px solid #4a3c1a; }

/* ---------- Φόρμες ---------- */
label.f { display: block; margin: 12px 0; }
label.f > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.inp { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; min-height: 48px; }
.inp:focus { border-color: var(--gold); }
.amount-in { font-size: 38px; font-weight: 700; text-align: center; background: transparent; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding: 6px 0; }
.amount-in:focus { border-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 12px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 600; }
.chip.sug { border-color: var(--gold); }
.seg { display: flex; background: var(--card); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--card2); color: var(--text); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.sw { position: relative; width: 48px; height: 28px; flex: none; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; }
.sw i::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.sw input:checked + i { background: var(--gold); }
.sw input:checked + i::after { transform: translateX(20px); }
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.meter.s1 i:nth-child(-n+1) { background: var(--bad); }
.meter.s2 i:nth-child(-n+2) { background: var(--warn); }
.meter.s3 i:nth-child(-n+3) { background: #9cc95a; }
.meter.s4 i { background: var(--good); }

/* ---------- Οθόνες κλειδώματος / αρχικής ρύθμισης ---------- */
.gate { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 4px calc(24px + var(--safe-b)); max-width: 420px; margin: 0 auto; }
.gate .logo { width: 76px; height: 76px; margin: 0 auto 14px; }
.gate h1 { text-align: center; margin: 0 0 4px; font-size: 26px; }
.gate p.lead { text-align: center; color: var(--muted); margin: 0 0 24px; }
.gate .err { color: var(--bad); text-align: center; min-height: 22px; margin-top: 8px; font-size: 14px; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.steps i { width: 26px; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--gold); }
.note { background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--muted); margin: 12px 0; }
.note b { color: var(--text); }

/* ---------- Γραφήματα ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tip { font-size: 13px; color: var(--text); min-height: 20px; margin-top: 6px; }
.catrow { padding: 8px 0; border-bottom: 1px solid var(--line); }
.catrow:last-child { border-bottom: 0; }
.catrow .row { margin-bottom: 6px; }
.monthnav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.monthnav b { font-size: 16px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); background: #f1e6c8; color: #221a08; padding: 10px 16px; border-radius: 12px; z-index: 200; font-weight: 600; font-size: 14px; animation: up .2s; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.4); display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: #7a5a10; font-weight: 700; cursor: pointer; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: rot .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; gap: 12px; }
.kv span:first-child { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Αστραπιαία καταχώριση ---------- */
.fastcard { padding: 12px; }
.freq { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.freq::-webkit-scrollbar { display: none; }
.fq { flex: none; display: flex; align-items: center; gap: 6px; border: 1px solid #4a3c1a; background: #2a2414; border-radius: 999px; padding: 8px 14px; font-weight: 650; cursor: pointer; touch-action: manipulation; }
.fq:active { transform: scale(.95); }
.cgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cg { border: 0; background: var(--surface); border-radius: 14px; padding: 10px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; min-width: 0; touch-action: manipulation; }
.cg:active { background: var(--card2); transform: scale(.95); }
.cg .e { font-size: 25px; line-height: 1.1; }
.cg .l { font-size: 11.5px; color: var(--muted); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; padding: 0 3px; }
.cgrid.big .cg { background: var(--card); padding: 12px 2px 10px; }
.qrow { display: flex; gap: 8px; margin-top: 10px; }
.qr { flex: 1; border: 0; background: var(--surface); border-radius: 12px; padding: 10px 6px; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.sheet .qr { background: var(--card); }
.qr:active { background: var(--card2); }

.kp-sheet { padding-bottom: calc(10px + var(--safe-b)); animation-duration: .12s; outline: none; }
.kp-head { display: flex; justify-content: center; }
.kp-cat { border: 0; background: var(--card); border-radius: 999px; padding: 8px 16px; font-size: 16px; font-weight: 650; cursor: pointer; }
.kp-cat:disabled { opacity: 1; cursor: default; }
.kp-amt { text-align: center; font-size: 46px; font-weight: 750; letter-spacing: -1px; margin: 10px 0 0; min-height: 60px; white-space: nowrap; overflow: hidden; }
.kp-amt .ph { color: var(--faint); }
.kp-amt .cur { color: var(--muted); font-size: 30px; margin-left: 6px; }
.kp-amt.shake { animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.kp-res { text-align: center; min-height: 20px; margin-bottom: 8px; }
.kp-accs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; align-items: center; padding-bottom: 2px; justify-content: center; flex-wrap: wrap; }
.kp-meta { display: flex; gap: 8px; align-items: center; margin: 10px 0; position: relative; }
.kp-meta .chip, .kp-accs .chip { padding: 7px 12px; }
.kp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; user-select: none; -webkit-user-select: none; }
.kp button { height: 58px; border: 0; color: var(--text); outline: none; border-radius: 14px; background: var(--card); font-size: 24px; font-weight: 600; cursor: pointer; touch-action: manipulation; transition: background .06s; }
.kp button.op { background: var(--card2); color: var(--muted); font-size: 22px; }
.kp button.down { background: #3a4560; }
.kp button.ok { grid-column: span 2; background: var(--gold); color: var(--gold-ink); font-size: 28px; }
.kp button.ok.down { background: #f0cd7a; }
@media (max-height: 700px) { .kp button { height: 50px; } .kp-amt { font-size: 38px; min-height: 50px; } }

/* ---------- v1.2 ---------- */
.cg .m { font-size: 11px; color: var(--gold); font-weight: 650; line-height: 1.1; }
.donut { display: flex; justify-content: center; margin: 4px 0 10px; }
.donut svg { width: 190px; height: 190px; }
.donut circle { transition: stroke-width .12s; }
.donut circle[data-catf]:active { stroke-width: 28; }
.dn-k { fill: var(--muted); font-size: 12px; }
.dn-v { fill: var(--text); font-size: 20px; font-weight: 700; }
.dlegend .dl { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.dlegend .dl:active { background: var(--card2); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-h { font-size: 11px; color: var(--faint); padding-bottom: 2px; }
.cal-d { aspect-ratio: 1; border-radius: 8px; background: var(--surface); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-d.now { outline: 2px solid var(--gold); outline-offset: -2px; }
.cal-d.fut { opacity: .35; }
.alert .ibtn { width: 32px; height: 32px; flex: none; }
