/* Kocly mini uygulamalar — ortak tasarım katmanı (Kocly v2 dili).
   Tüm uygulamalar bu dosyayı ve yerel Poppins dosyalarını kullanır. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/Poppins-Medium.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/Poppins-SemiBold.ttf") format("truetype"); }

:root {
  --ink: #203337;
  --ink-2: #5f6c6c;
  --ink-3: #8a9696;
  --teal: #1d545e;
  --teal-deep: #0f3a42;
  --teal-soft: #edf4f2;
  --teal-mid: #c9ddd8;
  --yellow: #f6bd35;
  --yellow-soft: #fdf1d3;
  --bg: #e5ece9;
  --surface: #f0f4f2;
  --card: #ffffff;
  --line: #e3e8e5;
  --success: #2f9e6b;
  --success-soft: #e3f3eb;
  --danger: #c8553d;
  --danger-soft: #f8e6e1;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(15, 58, 66, .06), 0 8px 24px rgba(15, 58, 66, .07);
  --shadow-lg: 0 18px 50px rgba(15, 58, 66, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(246, 189, 53, .85); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kabuk ---------- */
.app {
  position: relative;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 0px) 0 calc(var(--tabbar-h) + var(--safe-b) + 24px);
  background:
    radial-gradient(120% 50% at 100% 0%, rgba(29, 84, 94, .10), transparent 60%),
    radial-gradient(80% 40% at 0% 0%, rgba(246, 189, 53, .14), transparent 60%),
    var(--bg);
}
@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app { min-height: calc(100dvh - 48px); border-radius: 32px; box-shadow: var(--shadow-lg); overflow: clip; }
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px 12px;
  background: rgba(229, 236, 233, .86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar .app-icon { width: 38px; height: 38px; border-radius: 11px; flex: none; box-shadow: 0 2px 8px rgba(15,58,66,.2); }
.topbar .titles { flex: 1; min-width: 0; }
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.topbar .sub { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: var(--card); color: var(--teal-deep);
  box-shadow: var(--shadow);
}
.icon-btn svg { width: 20px; height: 20px; }

main { padding: 4px 16px 0; }
.view { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Alt sekme çubuğu ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; z-index: 30;
  transform: translateX(-50%);
  width: 100%; max-width: 560px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
@media (min-width: 700px) { .tabbar { bottom: 24px; border-radius: 0 0 32px 32px; } }
.tabbar button {
  display: grid; justify-items: center; gap: 2px;
  padding: 6px 4px; border: 0; background: none; border-radius: 14px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-3);
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-selected="true"] { color: var(--teal-deep); }
.tabbar button[aria-selected="true"] .tab-ic { background: var(--yellow); }
.tab-ic { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; transition: background .2s; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card.tight { padding: 14px; }
.card.soft { background: var(--surface); box-shadow: none; border: 1px solid var(--line); }
.card.hero {
  color: #fff;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(246, 189, 53, .22), transparent 55%),
    linear-gradient(140deg, var(--teal) 0%, var(--teal-deep) 100%);
  box-shadow: 0 14px 34px rgba(15, 58, 66, .28);
}
.card.hero .muted { color: rgba(255, 255, 255, .72); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 600; }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 20px 4px 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 15px;
  font-weight: 600; font-size: 15px;
  background: var(--teal); color: #fff;
  transition: transform .12s ease, background .2s, box-shadow .2s;
  box-shadow: 0 6px 16px rgba(29, 84, 94, .25);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn.block { width: 100%; }
.btn.yellow { background: var(--yellow); color: var(--teal-deep); box-shadow: 0 6px 16px rgba(246, 189, 53, .35); }
.btn.light { background: var(--teal-soft); color: var(--teal-deep); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--teal-deep); box-shadow: none; border: 1.5px solid var(--line); }
.btn.white { background: #fff; color: var(--teal-deep); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 12px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--teal); font-weight: 600; font-size: 13.5px; }

/* ---------- Segment & çipler ---------- */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; gap: 4px;
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
}
.seg button {
  min-height: 40px; border: 0; border-radius: 12px; background: none;
  font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--teal); color: #fff; box-shadow: 0 4px 10px rgba(29, 84, 94, .25); }
.seg.soft { background: var(--surface); box-shadow: none; }
.seg.soft button[aria-pressed="true"] { background: var(--card); color: var(--teal-deep); box-shadow: var(--shadow); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 99px;
  background: var(--card); color: var(--ink);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
  background: var(--teal-soft); color: var(--teal);
}
.badge.yellow { background: var(--yellow-soft); color: #8a5c00; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.est { background: var(--yellow-soft); color: #8a5c00; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; }

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 48px;
  padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--card);
  font-size: 16px; /* iOS yakınlaştırmasını önler */
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(29, 84, 94, .12); }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d545e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14.5px; }
.check input { width: 22px; height: 22px; accent-color: var(--teal); flex: none; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--teal-mid); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .2s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- Liste ---------- */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .label { font-weight: 500; }
.setting .hint { font-size: 12.5px; color: var(--ink-2); }

/* ---------- İstatistik kutuları ---------- */
.stat { padding: 14px; border-radius: 18px; background: var(--surface); }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--ink-2); }
.card.hero .stat { background: rgba(255, 255, 255, .1); }
.card.hero .stat .k { color: rgba(255, 255, 255, .72); }

.bar { height: 8px; border-radius: 99px; background: var(--teal-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width .4s ease; }
.bar.yellow > i { background: var(--yellow); }

/* ---------- Boş durum ---------- */
.empty { text-align: center; padding: 26px 18px 30px; }
.empty img { width: 120px; height: auto; margin: 0 auto 12px; }
.empty h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty p { color: var(--ink-2); font-size: 14px; max-width: 300px; margin: 0 auto 16px; }

/* ---------- Alt sayfa (sheet) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 30, 33, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(22px + var(--safe-b));
  animation: up .24s cubic-bezier(.2, .9, .3, 1);
  overscroll-behavior: contain;
}
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 28px; max-height: 86dvh; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet .grabber { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 19px; font-weight: 600; margin-bottom: 4px; letter-spacing: -.01em; }
.sheet .sheet-sub { color: var(--ink-2); font-size: 13.5px; margin-bottom: 16px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }

/* ---------- Bildirim (toast) ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 80; display: grid; justify-items: center; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 420px; padding: 12px 16px; border-radius: 14px;
  background: var(--teal-deep); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: up .22s ease;
}

/* ---------- Altbilgi ---------- */
.foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 0 6px; color: var(--ink-3); font-size: 12px; }
.foot img { height: 14px; width: auto; opacity: .7; }
.foot a { color: var(--teal); font-weight: 600; text-decoration: none; }
