/* Yummy Tarabya — bebek mavisi + pudra pembesi. Yazılar koyu lacivert kalır (pastel üstünde okunurluk için). */
:root {
  --bg: #F2F7FD; --surface: rgba(255,255,255,.56); --ink: #24304A; --ink2: #56667F; --muted: #6F7D98;
  --line: #E3EAF4; --line2: #EEF3FA;
  --blue: #CFE6FB; --blue-s: #EAF4FD; --blue-m: #A9D2F5; --blue-d: #4A9BE0;
  --pink: #F9D9E6; --pink-s: #FEF0F6; --pink-m: #F4B9D0; --pink-d: #DC6F9A;
  --lilac: #8F7AE0; --mint: #2FAE8F;
  --good: #006300; --bad: #C23B3B;
  --r: 20px; --r-sm: 14px;
  --shadow: 0 1px 2px rgba(36,48,74,.05), 0 8px 24px rgba(74,155,224,.10);
  --top: 64px;
  /* grafik renkleri (doğrulandı): dükkan / paket / gider */
  --s-shop: var(--pink-d); --s-pkg: var(--blue-d); --s-exp: var(--lilac);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); min-height: 100vh; background: #BBDBF8; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(135deg, #9CCBF6 0 50%, #F5B4D0 50% 100%); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { max-width: 1080px; margin: 0 auto; padding: 0 14px calc(96px + env(safe-area-inset-bottom)); }
#app.narrow { max-width: 680px; }

/* ---- üst bar ---- */
header.top { position: sticky; top: 0; z-index: 10; margin: 0 -14px 16px; padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(100deg, rgba(124,186,240,.94), rgba(240,140,184,.94)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.7); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .07em; font-size: 1rem; }
.brand .logo { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(36,48,74,.18); flex: none; }
.logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.who { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink2); }
.who .av { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; color: var(--blue-d); box-shadow: 0 2px 6px rgba(36,48,74,.08); }

/* ---- alt menü / masaüstünde üst menü ---- */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: flex; gap: 2px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(236,226,248,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid rgba(255,255,255,.8); }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border-radius: 14px; font-size: .7rem; font-weight: 600; color: var(--muted); text-decoration: none; }
nav.tabs a svg { width: 22px; height: 22px; }
nav.tabs a.on { color: var(--ink); background: linear-gradient(135deg, #86C0F2, #F29CC3); }
@media (min-width: 900px) {
  nav.tabs { position: static; justify-content: center; gap: 6px; padding: 0 0 16px; background: none; border: 0; backdrop-filter: none; }
  nav.tabs a { flex: none; flex-direction: row; gap: 8px; padding: 10px 18px; font-size: .92rem; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.85); }
  #app { padding-bottom: 40px; }
  header.top { border-radius: 0 0 24px 24px; margin-bottom: 18px; }
}

/* ---- kartlar ---- */
h2 { font-size: 1.15rem; margin: 22px 2px 10px; }
h2.sec { display: flex; align-items: center; gap: 8px; }
.card { background: var(--surface); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: var(--r); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.75); }
.card h3 { margin: 0; font-size: 1rem; }
.card .sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card.shop { background: linear-gradient(180deg, rgba(244,160,196,.80), rgba(255,255,255,.50) 72%); }
.card.pkg { background: linear-gradient(180deg, rgba(130,190,242,.80), rgba(255,255,255,.50) 72%); }
.chip-ic { width: 30px; height: 30px; border-radius: 10px; display: inline-grid; place-items: center; margin-right: 8px; vertical-align: middle; }
.chip-ic.shop { background: var(--pink); color: #B0406F; } .chip-ic.pkg { background: var(--blue); color: #2766A3; }
.row { display: flex; gap: 8px; align-items: center; } .row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cols { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .cols.two { grid-template-columns: 1fr 1fr; } .cols.main { grid-template-columns: 1.6fr 1fr; } }
@media (max-width: 420px) { .grid3 { grid-template-columns: 1fr 1fr; } }

/* ---- form ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: .78rem; font-weight: 600; color: var(--ink2); display: flex; justify-content: space-between; align-items: baseline; min-height: 1.1em; }
.field input, .field select, .field textarea { width: 100%; padding: 13px 14px; border: 1.5px solid rgba(255,255,255,.9); border-radius: var(--r-sm); background: rgba(255,255,255,.72); font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-d); box-shadow: 0 0 0 4px rgba(74,155,224,.18); }
.money { position: relative; }
.money input { text-align: right; font-size: 1.15rem; font-weight: 600; padding-right: 36px; background: rgba(255,255,255,.78); border-color: transparent; font-variant-numeric: tabular-nums; }

.money::after { content: "₺"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.money.cnt::after { content: "adet"; font-size: .7rem; right: 12px; }
.money.cnt input { padding-right: 48px; }
.money input::placeholder { color: #B4BED2; font-weight: 500; }
.st { font-size: .72rem; font-weight: 600; } .st.ok { color: var(--good); } .st.wait { color: var(--muted); } .st.err { color: var(--bad); }
.total { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-weight: 600; color: var(--ink2); }
.total b { color: var(--ink); font-size: 1.05rem; }

/* ---- butonlar ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-sm); padding: 13px 18px; font-weight: 700; font-size: .95rem; background: var(--ink); color: #fff; text-decoration: none; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.98); } .btn:hover { filter: brightness(1.12); }
.btn.alt { background: linear-gradient(135deg, #86C0F2, #F29CC3); color: var(--ink); }
.btn.ghost { background: rgba(255,255,255,.7); color: var(--ink); border: 1.5px solid rgba(255,255,255,.9); }
.btn.danger { background: rgba(255,255,255,.75); color: var(--bad); border: 1.5px solid #F0C3C3; }
.btn.block { width: 100%; } .btn.sm { padding: 8px 12px; font-size: .82rem; border-radius: 11px; } .btn:disabled { opacity: .5; }
.iconbtn { width: 42px; height: 42px; border-radius: 13px; border: 1.5px solid rgba(255,255,255,.9); background: rgba(255,255,255,.7); display: grid; place-items: center; color: var(--ink); }
.seg { display: inline-flex; background: rgba(255,255,255,.5); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 700; font-size: .82rem; color: var(--ink2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(36,48,74,.12); }
.seg.big { display: grid; grid-template-columns: 1fr 1fr; width: 100%; } .seg.big button { padding: 14px; font-size: .95rem; }
.seg.big button.on.nakit { background: var(--mint); color: #fff; } .seg.big button.on.kart { background: var(--blue-d); color: #fff; }
.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line2); color: var(--ink2); margin-left: 6px; vertical-align: middle; }
.badge.nakit { background: #D9F3EC; color: #146B57; } .badge.kart { background: var(--blue); color: #1F5C94; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill.up { background: #E1F4E1; color: var(--good); } .pill.down { background: #FBE4E4; color: var(--bad); } .pill.flat { background: var(--line2); color: var(--ink2); }
.pill svg { width: 12px; height: 12px; stroke-width: 2.6; }

/* ---- tarih çubuğu ---- */
.datebar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.datebar .d { flex: 1; text-align: center; font-weight: 800; font-size: 1.05rem; }
.datebar .d small { display: block; color: var(--muted); font-weight: 600; font-size: .75rem; }
.chips { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.chip { border: 1.5px solid rgba(255,255,255,.9); background: rgba(255,255,255,.65); border-radius: 999px; padding: 10px 20px; font-weight: 700; color: var(--ink2); }
.chip.on { background: linear-gradient(135deg, #86C0F2, #F29CC3); border-color: transparent; color: var(--ink); }

/* ---- KPI ---- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
@media (min-width: 900px) { .kpis { grid-template-columns: 1.5fr 1fr 1fr; } }
.kpi { background: var(--surface); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); border: 1px solid rgba(227,234,244,.8); position: relative; overflow: hidden; min-width: 0; }
.kpi small { display: block; color: var(--ink2); font-size: .78rem; font-weight: 600; }
.kpi .v { display: block; font-size: 1.45rem; font-weight: 800; margin: 4px 0 6px; letter-spacing: -.01em; }
.kpi.hero { grid-column: 1 / -1; background: linear-gradient(135deg, #A5D1F5 0%, #F5B3CF 100%); }
@media (min-width: 900px) { .kpi.hero { grid-column: auto; } }
.kpi.hero .v { font-size: 2.3rem; }
.kpi .spark { position: absolute; right: 12px; bottom: 10px; opacity: .9; }
.kpi .cmp { font-size: .72rem; color: var(--ink2); margin-top: 4px; }
.neg { color: var(--bad); }

/* ---- grafik ---- */
.chartbox { position: relative; width: 100%; }
.chartbox svg { display: block; width: 100%; height: auto; overflow: visible; }
.chartbox svg text { font-family: inherit; fill: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: .8rem; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; } .legend i.ln { height: 3px; width: 16px; border-radius: 2px; }
.legend b { color: var(--ink); }
#tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px; font-size: .78rem; box-shadow: 0 8px 24px rgba(36,48,74,.28); opacity: 0; transition: opacity .1s; max-width: 240px; }
#tip.on { opacity: 1; }
#tip .th { color: #B9C4DA; font-weight: 600; margin-bottom: 5px; }
#tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 1px 0; }
#tip .tr .k { display: inline-flex; align-items: center; gap: 6px; color: #B9C4DA; } #tip .tr .k i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; } #tip .tr .k i.sq { height: 9px; width: 9px; border-radius: 2px; }
#tip .tr b { color: #fff; font-size: .85rem; }
.hb { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: .86rem; }
.hb .track { height: 14px; background: rgba(36,48,74,.07); border-radius: 0 7px 7px 0; }
.hb .fill { height: 100%; border-radius: 0 7px 7px 0; min-width: 2px; transition: width .4s; }
.hb .val { font-weight: 700; text-align: right; min-width: 6.2em; } .hb .val small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.hb .lab { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.t th { color: var(--muted); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
table.t td, table.t th { padding: 9px 4px; border-bottom: 1px solid var(--line2); text-align: right; font-variant-numeric: tabular-nums; }
table.t td:first-child, table.t th:first-child { text-align: left; }
table.t tr:last-child td { border-bottom: 0; } table.t tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
.scroll { overflow-x: auto; }

/* ---- listeler ---- */
.exp { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); cursor: pointer; }
.exp:last-child { border-bottom: 0; } .exp .meta { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.exp.del { opacity: .5; text-decoration: line-through; cursor: default; }
.dayrow { display: grid; grid-template-columns: 5.6rem 1fr 1fr 1fr; gap: 6px; padding: 12px 8px; border-bottom: 1px solid var(--line2); font-size: .88rem; text-align: right; cursor: pointer; align-items: center; border-radius: 10px; font-variant-numeric: tabular-nums; }
.dayrow:hover { background: rgba(169,210,245,.35); } .dayrow.head { font-weight: 700; color: var(--muted); cursor: default; font-size: .72rem; text-transform: uppercase; } .dayrow.head:hover { background: none; }
.dayrow span:first-child { text-align: left; font-weight: 600; } .dayrow.today { background: rgba(244,185,208,.45); }
.hist { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line2); }
.hist:last-child { border-bottom: 0; } .hist .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--blue); color: #2766A3; }
.hist .ic.del { background: #FBE4E4; color: var(--bad); } .hist .ic.add { background: #D9F3EC; color: #146B57; } .hist .ic.upd { background: var(--pink); color: #B0406F; }
.hist .tx { font-size: .9rem; min-width: 0; } .hist small { display: block; color: var(--muted); margin-top: 2px; } .hist.rev { opacity: .55; }
.user { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line2); } .user:last-child { border-bottom: 0; } .user.off { opacity: .5; }
.user .av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--pink)); display: grid; place-items: center; font-weight: 800; flex: none; }
.note { font-size: .82rem; color: var(--muted); } .center { text-align: center; color: var(--ink2); padding: 30px 0; }
.banner { background: #FFF6DB; border: 1px solid #F2DB8E; color: #6b5200; padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 14px; font-size: .88rem; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }

/* ---- sheet ---- */
.sheet-bg { position: fixed; inset: 0; background: rgba(36,48,74,.45); backdrop-filter: blur(3px); z-index: 30; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 26px 26px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; animation: up .2s; }
.sheet h3 { margin: 0 0 4px; font-size: 1.15rem; } .sheet .sub { color: var(--muted); font-size: .85rem; margin-bottom: 16px; } .sheet .field { margin-bottom: 14px; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 26px; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } } @keyframes fade { from { opacity: 0; } }
.err { color: var(--bad); text-align: center; min-height: 1.4em; font-weight: 600; font-size: .9rem; }

/* ---- giriş ---- */
.login { max-width: 400px; margin: 7vh auto 0; background: rgba(255,255,255,.55); border-radius: 28px; padding: 28px 22px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.login .logo { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; margin: 0 auto 14px; border: 4px solid #fff; box-shadow: 0 6px 22px rgba(220,111,154,.35); }
.login h1 { text-align: center; letter-spacing: .09em; margin: 0 0 4px; font-size: 1.4rem; } .login p.sub { text-align: center; color: var(--muted); margin: 0 0 18px; }
.pinbox { text-align: center !important; letter-spacing: .6em; font-size: 1.8rem !important; padding: 12px !important; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 6px; }
.pad button { padding: 17px 0; font-size: 1.35rem; font-weight: 700; background: rgba(255,255,255,.7); border: 1.5px solid rgba(255,255,255,.9); border-radius: 16px; color: var(--ink); }
.pad button:active { background: var(--blue-s); } .pad button.go { background: var(--ink); color: #fff; border-color: var(--ink); font-size: 1rem; }
#toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Beyaz pencerelerin içinde kutular okunsun (yarı saydam beyaz, beyaz üstünde kaybolur) */
.sheet .field input, .sheet .field select, .sheet .field textarea { background: var(--blue-s); border-color: var(--line); }
.sheet .seg.big { background: var(--blue-s); border: 1.5px solid var(--line); }
.sheet .btn.ghost { background: var(--blue-s); border-color: var(--line); }

/* ---- kilit ekranı ---- */
.lock { position: fixed; inset: 0; z-index: 100; overflow: auto; padding: 14px; background: linear-gradient(135deg, #9CCBF6 0 50%, #F5B4D0 50% 100%); display: flex; align-items: flex-start; justify-content: center; }
.lock .login { width: 100%; margin-top: 5vh; background: rgba(255,255,255,.6); }
.login a, .lock a { color: var(--ink2); font-weight: 600; }

/* tarih seçici: görünmez tarih alanı yazının üstünü kaplar, dokununca takvim açılır */
.datebtn { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.datebtn .dt { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 14px; background: rgba(255,255,255,.6); border: 1.5px solid rgba(255,255,255,.9); cursor: pointer; font-weight: 800; }
.datebtn .dt:hover { background: rgba(255,255,255,.85); }
.datebtn .dt svg { color: var(--blue-d); }
.datepick { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.datebtn small, .linklike { color: var(--muted); font-weight: 600; font-size: .75rem; }
.linklike { background: none; border: 0; text-decoration: underline; padding: 2px 6px; position: relative; z-index: 2; }
