/* Assist — sakin bir ajanda: sıcak kâğıt zemin, koyu mürekkep, tek vurgu rengi. Renkler kayıt türünü anlatır. */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #ece9e1;
  --ink: #1d1f23;
  --ink-2: #4b4f57;
  --muted: #8a8d93;
  --line: #e2ded4;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --randevu: #6a4bc4;
  --hatirlatici: #c26a1b;
  --alisveris: #2f7d4a;
  --not: #6b7280;
  --gec: #c0392b;
  --shadow: 0 1px 2px rgba(29, 31, 35, 0.05), 0 8px 24px rgba(29, 31, 35, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1b1d21;
    --surface-2: #26292e;
    --ink: #eceae5;
    --ink-2: #b9bbc0;
    --muted: #8a8e96;
    --line: #2c2f35;
    --accent: #7fc2ab;
    --accent-ink: #0f1a16;
    --randevu: #a58cf0;
    --hatirlatici: #e9994f;
    --alisveris: #6cc48a;
    --not: #a0a6b0;
    --gec: #f07a6e;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.kucuk { font-size: 13px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; word-break: break-all; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--surface-2); color: var(--ink); min-height: 44px;
}
.btn.small { padding: 7px 12px; font-size: 14px; min-height: 36px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { color: var(--gec); }
.btn.blok { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: 0.55; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tabbar button:focus-visible, .seg button:focus-visible, .tik:focus-visible, .icon-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.icon-btn { background: var(--surface); border: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); box-shadow: var(--shadow); cursor: pointer; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 12px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px; min-width: 0;
}
textarea { resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type="date"], input[type="time"] { min-height: 46px; -webkit-appearance: none; }

/* --- giriş --- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-t) + 24px) 16px 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 22px; padding: 28px 22px; box-shadow: var(--shadow); }
.login-logo { border-radius: 15px; }
.login h1 { margin: 10px 0 4px; font-size: 28px; letter-spacing: -0.02em; }
.login .muted { margin: 0 0 6px; }
.login .btn { width: 100%; margin-top: 16px; }
.err { color: var(--gec); font-size: 14px; margin: 8px 0 0; }

/* --- iskelet --- */
.app { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 96px); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.top small { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.top h1 { margin: 2px 0 0; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; }

.hizli { position: sticky; top: 0; z-index: 5; margin: 0 -16px 8px; padding: calc(var(--safe-t) * 0 + 8px) 16px 6px; background: var(--bg); }
.hizli-kutu { display: flex; gap: 8px; background: var(--surface); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.hizli-kutu input { border: 0; background: transparent; padding: 10px 8px; }
.hizli-kutu input:focus-visible { outline: none; }
.hizli-kutu:focus-within { border-color: var(--accent); }
.onizleme { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; padding: 6px 2px 0; font-size: 13px; }
.onizleme:empty { padding: 0; }
.cip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.cip.tur { color: #fff; }

.seg { display: flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; min-height: 36px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.filtre { margin: 6px 0 4px; }

.ozet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.ozet div { background: var(--surface); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--shadow); }
.ozet b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ozet span { font-size: 12px; color: var(--muted); font-weight: 600; }
.ozet .gec b { color: var(--gec); }

/* --- liste --- */
.grup { margin-top: 18px; }
.grup h3 { margin: 0 4px 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: flex; justify-content: space-between; }
.grup.gec h3 { color: var(--gec); }
.kutu { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.oge { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px 12px 12px; border-top: 1px solid var(--line); position: relative; }
.oge:first-child { border-top: 0; }
.oge::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--renk, transparent); }
.t-randevu { --renk: var(--randevu); }
.t-hatirlatici { --renk: var(--hatirlatici); }
.t-alisveris { --renk: var(--alisveris); }
.t-not { --renk: var(--not); }
.tik { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: transparent; margin-top: 1px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tik svg { width: 14px; height: 14px; opacity: 0; }
.oge.tamam .tik { background: var(--renk, var(--accent)); border-color: var(--renk, var(--accent)); color: #fff; }
.oge.tamam .tik svg { opacity: 1; }
.oge.tamam .baslik { text-decoration: line-through; color: var(--muted); }
.govde { flex: 1; min-width: 0; cursor: pointer; }
.baslik { font-weight: 600; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); margin-top: 2px; }
.meta .zmn { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.oge.gecikti .meta .zmn { color: var(--gec); }
.meta .etk { color: var(--renk); font-weight: 600; }
.meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.notmetin { font-size: 14px; color: var(--ink-2); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.zil { flex: none; border: 0; background: var(--surface-2); color: var(--ink-2); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.zil.kurulu { background: color-mix(in srgb, var(--renk, var(--accent)) 16%, transparent); color: var(--renk, var(--accent)); }
.zil svg { width: 18px; height: 18px; }
.bos { text-align: center; color: var(--muted); padding: 34px 16px; }
.bos b { display: block; color: var(--ink-2); font-size: 17px; margin-bottom: 4px; }
.ac-kapa { background: none; border: 0; color: var(--muted); font-weight: 600; font-size: 14px; padding: 14px 4px 4px; cursor: pointer; }
.alt-eylem { display: flex; justify-content: space-between; margin-top: 10px; }

/* --- kartlar (ayarlar) --- */
.kart { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-top: 12px; }
.kart h2 { margin: 0 0 6px; font-size: 18px; }
.kart p { margin: 6px 0 10px; color: var(--ink-2); }
.kart .btn + .btn { margin-left: 6px; }
.kopya { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin: 10px 0; }
.kopya span { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kopya code { padding: 8px 10px; font-size: 13px; }
details { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
summary { font-weight: 600; cursor: pointer; color: var(--accent); }
.adimlar { padding-left: 20px; color: var(--ink-2); margin: 10px 0 0; }
.adimlar li { margin-bottom: 8px; }

/* --- alt sekme çubuğu --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(var(--safe-b) + 6px);
}
.tabbar button { position: relative; flex: 1; max-width: 140px; border: 0; background: none; color: var(--muted); display: grid; justify-items: center; gap: 2px; padding: 4px 0; font-size: 11px; font-weight: 600; cursor: pointer; min-height: 44px; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--accent); }
.rozet { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--alisveris); color: #fff; font-size: 11px; font-style: normal; line-height: 18px; }

/* --- alt sayfa (dialog) --- */
dialog.sheet {
  border: 0; padding: 0; width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 20px 20px 0 0;
  background: var(--bg); color: var(--ink); max-height: 92dvh;
}
@media (min-width: 600px) { dialog.sheet { margin: auto; border-radius: 20px; } }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog.sheet form, .alarm-kur { padding: 8px 16px calc(var(--safe-b) + 20px); }
.sheet-bas { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 0 10px; position: sticky; top: 0; background: var(--bg); }
.sheet-bas > :first-child { justify-self: start; }
.sheet-bas > :last-child { justify-self: end; }
.tur-sec { margin: 4px 0 0; }
.tur-sec button[data-tur="randevu"].on { color: var(--randevu); }
.tur-sec button[data-tur="hatirlatici"].on { color: var(--hatirlatici); }
.tur-sec button[data-tur="alisveris"].on { color: var(--alisveris); }
.tur-sec button[data-tur="not"].on { color: var(--not); }
.iki { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sil { width: 100%; margin-top: 18px; }
.ak-oge { font-weight: 700; font-size: 18px; margin: 6px 0 0; }

/* --- çalan alarm --- */
.caliyor { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 16px; }
.cal-kart { width: 100%; max-width: 380px; background: var(--surface); border-radius: 24px; padding: 26px 20px 20px; text-align: center; }
.cal-zil { font-size: 52px; animation: salla 0.6s ease-in-out infinite alternate; }
@keyframes salla { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .cal-zil { animation: none; } }
.cal-kart h2 { margin: 8px 0 2px; font-size: 22px; overflow-wrap: anywhere; }
.cal-kart p { margin: 0 0 16px; color: var(--ink-2); }
.cal-eylem { display: grid; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 84px); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 60; max-width: calc(100% - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast button { pointer-events: auto; margin-left: 10px; background: none; border: 0; color: var(--accent); font-weight: 700; padding: 0; }
@media (prefers-color-scheme: dark) { .toast button { color: #2f5d50; } }
