/* bet — κέρδη / χασίματα ανά μήνα · πράσινο (23/11), ανοιχτό, γειωμένο, απαλές σκιές */
:root {
  --bg: #f2f7f4;
  --card: #ffffff;
  --line: #dde9e2;
  --line-strong: #c4d9cc;
  --ink: #13221a;
  --muted: #5b6e63;
  --accent: #15803d;
  --accent-strong: #116632;
  --accent-ink: #ffffff;
  --accent-soft: #dcf3e4;
  --ring: rgba(21, 128, 61, .2);
  --band-1: #0a3324;
  --band-2: #0f5a3c;
  --band-3: #15804c;
  /* πολικότητα: πάνω από το 0 = κέρδος, κάτω = χάσιμο (και η κατεύθυνση της ράβδου το λέει) */
  --win: #1f9254;
  --win-soft: #a9dcbd;
  --win-bg: #e6f5ec;
  --loss: #d4483b;
  --loss-soft: #f2b2aa;
  --loss-bg: #fdecea;
  --win-text: #137044;
  --loss-text: #b42318;
  --line-ink: #23362c;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 60, 35, .06), 0 8px 24px rgba(10, 60, 35, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; margin: 2px 0 0; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num, .hero-num, .tile b, .year-total b { font-variant-numeric: tabular-nums; }

/* ---------- κουμπιά / πεδία ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  font: 650 14.5px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: transparent; color: var(--ink); transition: background .15s, border-color .15s, transform .1s;
}
.btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #1a9149, var(--accent)); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 2px 6px rgba(17, 102, 50, .25); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.btn-danger { background: var(--loss); color: #fff; }
.btn-danger-text { color: var(--loss-text); padding: 0 10px; }
.btn-danger-text:hover { background: var(--loss-bg); }
.btn-block { width: 100%; }
.btn-band { height: 36px; padding: 0 12px; color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); font-size: 13.5px; }
.btn-band:hover { background: rgba(255, 255, 255, .18); }
.btn-icon { width: 36px; padding: 0; }

input[type=text], input[type=password], input[type=date] {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 11px;
  background: #fff; color: var(--ink); font: 15.5px/1.35 var(--font);
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input.bad { border-color: var(--loss); background: #fff7f6; box-shadow: 0 0 0 3px rgba(212, 72, 59, .15); }
.fld { display: block; margin: 0; min-width: 0; }
.fld > span { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.fld > span i { font-style: normal; font-weight: 500; opacity: .8; }

/* ---------- ζώνη (κεφαλίδα) ---------- */
.band {
  color: #fff;
  background:
    radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.2px) 0 0 / 18px 18px,
    linear-gradient(125deg, var(--band-1) 0%, var(--band-2) 55%, var(--band-3) 100%);
  padding-bottom: 70px;
}
.band-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.band-top { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.band-actions { display: flex; align-items: center; gap: 8px; }
.band-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 14px 0 6px; flex-wrap: wrap; }
.eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.month-nav { display: flex; align-items: center; gap: 14px; }
.month-title { min-width: 0; }
.month-title h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.mnav {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; transition: background .15s;
}
.mnav svg { width: 20px; height: 20px; stroke-width: 2.4; }
.mnav:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.mnav:disabled { opacity: .35; cursor: default; }
.hero { text-align: right; }
.hero-num { display: block; font-size: 48px; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; margin: 4px 0 10px; white-space: nowrap; }
.hero-split { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 13px; color: rgba(255, 255, 255, .85); }
.chip b { color: #fff; font-variant-numeric: tabular-nums; }
.chip i { width: 9px; height: 9px; border-radius: 3px; }
.chip-win i { background: #6fd39a; }
.chip-loss i { background: #ff9a8f; }

/* ---------- λογότυπο ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: #fff; position: relative; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: #fff; color: var(--accent); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.logo-mark svg { width: 24px; height: 24px; stroke-width: 3.2; }
.logo-mark .lm-line { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .7s .15s ease-out forwards; }
.logo-mark .lm-arrow { opacity: 0; animation: pop .25s .75s ease-out forwards; }
.logo-word { font-size: 24px; font-weight: 800; letter-spacing: -.02em; display: inline-flex; }
.logo-word span { display: inline-block; animation: sprout .45s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(.2s + var(--l) * 70ms); }
.logo-by {
  position: relative; align-self: flex-start; margin: -6px 0 0 -2px; padding: 2px 7px; border-radius: 9px;
  background: #fff; color: var(--accent-strong); font-size: 11px; font-weight: 800; letter-spacing: .02em;
  transform: rotate(-4deg); animation: bubble-pop .4s .65s cubic-bezier(.3, 1.4, .5, 1) both;
}
.logo-by::before { content: ""; position: absolute; left: 5px; bottom: -4px; border: 5px solid transparent; border-top-color: #fff; border-bottom: 0; border-left-width: 2px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes bubble-pop {
  0%   { opacity: 0; transform: scale(0) rotate(-4deg); }
  70%  { opacity: 1; transform: scale(1.12) rotate(-7deg); }
  100% { opacity: 1; transform: rotate(-4deg); }
}
@keyframes sprout { from { opacity: 0; transform: translateY(8px) scale(.9); } }

/* ---------- περιεχόμενο ---------- */
.wrap { max-width: 1120px; margin: -52px auto 0; padding: 0 20px 60px; position: relative; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px 0; flex-wrap: wrap; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 700; }

/* καταχώριση */
.add-card { display: grid; grid-template-columns: auto minmax(150px, 1.1fr) 170px minmax(140px, 1.4fr) auto; gap: 14px; align-items: end; padding: 16px 18px; margin-bottom: 16px; animation: rise .45s ease-out both; }
.sign { display: inline-flex; gap: 6px; padding: 4px; border-radius: 13px; background: #eef4f0; border: 1px solid var(--line); align-self: end; }
.sign-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 9px;
  border: 0; background: transparent; color: var(--muted); font: 700 14px/1 var(--font); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.sign-btn svg { width: 16px; height: 16px; stroke-width: 2.6; }
.sign-btn:hover { color: var(--ink); }
.sign-btn.win.on { background: var(--win); color: #fff; box-shadow: 0 2px 6px rgba(31, 146, 84, .3); }
.sign-btn.loss.on { background: var(--loss); color: #fff; box-shadow: 0 2px 6px rgba(212, 72, 59, .3); }
.amount-wrap { position: relative; display: flex; align-items: center; }
.amount-wrap input { padding-left: 32px; padding-right: 30px; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.amount-sign { position: absolute; left: 12px; font-size: 20px; font-weight: 800; color: var(--win-text); pointer-events: none; }
.amount-wrap.neg .amount-sign { color: var(--loss-text); }
.amount-wrap em { position: absolute; right: 12px; font-style: normal; font-weight: 700; color: var(--muted); pointer-events: none; }
.btn-add { height: 44px; padding: 0 20px; }

/* κουτάκια */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; animation: rise .45s ease-out both; animation-delay: calc(80ms + var(--k, 0) * 60ms); }
.tile-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tile-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.tile-ic svg { width: 19px; height: 19px; stroke-width: 1.9; }
.tile-top > span { font-size: 13px; font-weight: 650; color: var(--muted); line-height: 1.25; }
.tile b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.tile.main { border-color: #bfe3cc; background: linear-gradient(180deg, #f3fbf6, #fff 70%); }
.tile.main b { font-size: 30px; }
b.pos { color: var(--win-text); }
b.neg { color: var(--loss-text); }
.tile .ic-loss { background: var(--loss-bg); color: var(--loss-text); }

/* γραφήματα */
.chart-card { margin-bottom: 16px; animation: rise .45s .2s ease-out both; }
.legend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; }
.lg-win, .lg-loss { width: 10px; height: 10px; border-radius: 3px; }
.lg-win { background: var(--win); }
.lg-loss { background: var(--loss); }
.lg-line { width: 18px; height: 2px; background: var(--line-ink); border-radius: 2px; }
.lg-avg { width: 18px; border-top: 2px dashed #8aa596; }
.chart { position: relative; padding: 6px 10px 10px 4px; }
.chart svg { display: block; width: 100%; overflow: visible; stroke: none; }
.chart .grid line { stroke: #e9f0ec; stroke-width: 1; }
.chart .grid line.zero { stroke: #a9bdb1; }
.chart .ax text { fill: var(--muted); font: 11.5px var(--font); font-variant-numeric: tabular-nums; }
.chart .ax text.today { fill: var(--accent-strong); font-weight: 800; }
.chart .ax text.sel { fill: var(--ink); font-weight: 800; }
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-grow .55s cubic-bezier(.25, .8, .35, 1) both; animation-delay: calc(250ms + var(--k) * 18ms); }
.chart .bar.neg { transform-origin: 50% 0; }
.chart.still .bar { animation: none; }
.chart .bar.win { fill: var(--win); }
.chart .bar.loss { fill: var(--loss); }
.chart-year .bar.win { fill: var(--win-soft); }
.chart-year .bar.loss { fill: var(--loss-soft); }
.chart-year .bar.win.sel { fill: var(--win); }
.chart-year .bar.loss.sel { fill: var(--loss); }
.chart .future { fill: #f4f8f6; }
.chart .cum { stroke: var(--line-ink); stroke-width: 2; fill: none; }
.chart .cum-end { fill: var(--line-ink); stroke: #fff; stroke-width: 2; }
.chart .avg { stroke: #8aa596; stroke-width: 2; stroke-dasharray: 5 4; }
.chart .avg-lbl { fill: #4f6a5b; font: 700 11.5px var(--font); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .cross { stroke: #9fb4a8; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .slot.on .bar { filter: brightness(.88); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.chart-empty span { background: rgba(255, 255, 255, .92); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
@keyframes bar-grow { from { transform: scaleY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 170px; max-width: 260px;
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(10, 50, 30, .16); padding: 10px 12px; font-size: 13px;
}
.tip h4 { margin: 0 0 6px; font-size: 13px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; margin-top: 3px; color: var(--muted); }
.tip .r b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tip .r i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.tip .notes { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }

/* λίστα + έτος */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.list-card, .year-card { animation: rise .45s .28s ease-out both; }
.year-total { text-align: right; }
.year-total span { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.year-total b { font-size: 20px; font-weight: 800; }
#list { padding: 8px 8px 10px; }
.day { margin: 4px 0 2px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 10px 6px; border-bottom: 1px solid var(--line); }
.day-head span { font-size: 13px; font-weight: 700; color: var(--muted); }
.day-head span.is-today { color: var(--accent-strong); }
.day-head b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.entry {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 20px; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 11px; background: none; text-align: left; color: inherit; font: inherit; cursor: pointer;
  animation: sprout .35s ease-out both; animation-delay: calc(var(--k, 0) * 25ms);
}
.entry:hover { background: #f3f8f5; }
.entry .e-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.entry .e-ic svg { width: 15px; height: 15px; stroke-width: 2.6; }
.entry.pos .e-ic { background: var(--win-bg); color: var(--win-text); }
.entry.neg .e-ic { background: var(--loss-bg); color: var(--loss-text); }
.entry .e-note { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .e-note.none { color: #9aaba1; }
.entry .e-amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry.pos .e-amt { color: var(--win-text); }
.entry.neg .e-amt { color: var(--loss-text); }
.entry .e-edit { color: #a3b5aa; width: 18px; height: 18px; }
.entry:hover .e-edit { color: var(--accent); }
.entry.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: #c9ecd6; } 100% { background: transparent; } }
.empty { padding: 30px 20px 34px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

/* παράθυρο */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(10, 40, 25, .25); color: var(--ink); }
.dlg::backdrop { background: rgba(10, 30, 20, .4); }
.dlg form { padding: 20px; display: grid; gap: 14px; }
.dlg .sign { justify-self: start; }
.dlg-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dlg-actions .grow { flex: 1; }
.dlg-body { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--loss-text); }

/* είσοδος */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.2px) 0 0 / 18px 18px,
    linear-gradient(125deg, var(--band-1) 0%, var(--band-2) 55%, var(--band-3) 100%); }
.auth-card { width: min(380px, 100%); background: #fff; border-radius: 20px; padding: 26px 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); display: grid; gap: 14px; }
.auth-card .logo { color: var(--ink); justify-self: start; margin-bottom: 6px; }
.auth-card .logo-mark { background: var(--accent); color: #fff; }
.auth-card .logo-by { background: var(--accent-soft); }
.auth-card .logo-by::before { border-top-color: var(--accent-soft); }
.auth-card h1 { font-size: 22px; }
.auth-card p { margin: 0; }
.alert { background: var(--loss-bg); color: var(--loss-text); padding: 9px 12px; border-radius: 10px; font-weight: 600; }
.auth-card form { display: grid; gap: 14px; }

/* ---------- κινητό ---------- */
@media (max-width: 900px) {
  .add-card { grid-template-columns: 1fr 1fr; }
  .add-card .sign { grid-column: 1 / -1; justify-self: stretch; }
  .add-card .sign-btn { flex: 1; height: 40px; }
  .fld-amount { grid-column: 1 / -1; }
  .fld-note { grid-column: 2; }
  .btn-add { grid-column: 1 / -1; height: 48px; font-size: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .band { padding-bottom: 62px; }
  .band-in { padding: 0 16px; }
  .band-top { height: 56px; }
  .band-main { flex-direction: column; align-items: stretch; gap: 14px; padding-top: 6px; }
  .month-nav { justify-content: space-between; }
  .month-title { text-align: center; }
  .month-title h1 { font-size: 25px; }
  .hero { text-align: center; }
  .hero-num { font-size: 40px; margin-bottom: 8px; }
  .hero-split { justify-content: center; }
  .wrap { padding: 0 12px 40px; margin-top: -48px; }
  .add-card { padding: 14px; gap: 12px; }
  .amount-wrap input { font-size: 24px; min-height: 52px; }
  .amount-sign { font-size: 24px; }
  .tiles { gap: 10px; }
  .tile { padding: 12px 13px; }
  .tile b, .tile.main b { font-size: 21px; }
  .tile-ic { width: 30px; height: 30px; }
  .card-head { padding: 14px 14px 0; }
  .legend { gap: 4px 10px; font-size: 12px; }
  .chart { padding: 4px 4px 8px 0; }
  .logo-word { font-size: 21px; }
  .btn-band:not(.btn-icon) { padding: 0 10px; font-size: 12.5px; }
}
@media (max-width: 380px) {
  .add-card { grid-template-columns: 1fr; }
  .fld-note { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .logo-mark .lm-line { stroke-dashoffset: 0; }
  .logo-mark .lm-arrow { opacity: 1; }
}
