:root {
  --bg: #f2f2f7; --card: #fff; --text: #111; --muted: #6b7280; --line: #e5e7eb;
  --accent: #0f766e; --danger: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --text: #f5f5f7; --muted: #9ca3af; --line: #2c2c2e; --accent: #2dd4bf; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
main { padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 84px); max-width: 640px; margin: 0 auto; }
h1 { font-size: 28px; margin: 0 0 16px; }
.card { background: var(--card); border-radius: 12px; padding: 4px 16px; margin-bottom: 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .muted, .muted { color: var(--muted); font-size: 14px; }
button { font: inherit; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; }
.btn:disabled { opacity: .5; }
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabbar button { flex: 1; background: none; border: 0; padding: 14px 0; color: var(--muted); }
#tabbar button.active { color: var(--accent); font-weight: 600; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 76px);
  background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 90%; z-index: 20; }
#update-banner { position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; z-index: 10; display: flex;
  justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--accent); color: #fff; }
#update-banner[hidden], #toast[hidden] { display: none; }
#update-banner button { background: #fff; color: var(--accent); border: 0; border-radius: 8px; padding: 6px 12px; }

h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 20px 4px 8px; }
.kayit { cursor: pointer; }
.kayit .sol { min-width: 0; }
.kayit .baslik { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kayit .sag { text-align: right; flex-shrink: 0; }
.kayit .kalan { font-weight: 600; }
.kayit.gecikmis .kalan, .kayit.gecikmis .baslik { color: var(--danger); }
.kayit.bugun .kalan { color: #d97706; }
.kayit.ertelendi { opacity: .55; }
.uyari { background: #fef3c7; color: #92400e; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.link { background: none; border: 0; color: var(--accent); padding: 8px 4px; }
.fab { position: fixed; right: 20px; bottom: calc(env(safe-area-inset-bottom) + 76px); width: 56px; height: 56px;
  border-radius: 28px; border: 0; background: var(--accent); color: #fff; font-size: 32px; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.form { padding: 8px 16px 16px; }
.form label { display: block; font-size: 13px; color: var(--muted); padding-top: 12px; }
.form input, .form select, .form textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.form .iki { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.form .butonlar { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; }
.btn.ikincil { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn.tehlike { background: var(--danger); margin-left: auto; }
.hata { color: var(--danger); font-size: 14px; padding-top: 12px; }
.notlar { white-space: pre-wrap; font-size: 15px; }
#eylem.butonlar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ek-ad { color: var(--accent); text-decoration: none; word-break: break-all; }
.ek-ekle { display: inline-block; cursor: pointer; }
.md { white-space: pre-wrap; word-break: break-word; font: 14px/1.5 ui-monospace, Menlo, monospace; margin: 12px 0; }
.gorsel { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.gorsel-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; border-bottom: 1px solid var(--line); background: var(--card); }
.gorsel-bar .link { font-size: 17px; padding: 8px; }
.gorsel-ad { flex: 1; text-align: center; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gorsel-cerceve { flex: 1; width: 100%; border: 0; background: #fff; }
.gorsel-icerik { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; background: #888; }
.pdf-sayfa { display: block; margin: 0 auto 8px; background: #fff; }
input.kucuk { width: 96px; text-align: right; font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.gecerli summary { color: var(--accent); cursor: pointer; padding: 4px 0; }
.gecerli p { font-size: 13px; line-height: 1.7; margin: 8px 0 0; }
.satir-butonlar { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.satir-butonlar .btn { padding: 6px 12px; font-size: 14px; }
.chip { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 4px 10px; font-size: 13px; margin: 2px 2px 0 0; }
.gecmis-satir .baslik { white-space: normal; }
.gecmis-belge { font-size: 13px; line-height: 1.7; margin-top: 4px; }
.gecmis-belge .ek-ad { font-size: 13px; }
.form label.onay { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form label.onay input { display: inline-block; width: auto; margin: 0; }
.link.ek-ekle { display: inline-block; }
.ozet .row b { font-variant-numeric: tabular-nums; }
.rozetler { margin-top: 4px; }
.rozet { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); margin-right: 4px; }
.rozet.kirmizi { color: var(--danger); border-color: var(--danger); }
.rozet.turuncu { color: #d97706; border-color: #d97706; }
#gelen-banner { position: fixed; top: calc(env(safe-area-inset-top) + 44px); left: 0; right: 0; z-index: 9; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: #d97706; color: #fff; }
#gelen-banner[hidden] { display: none; }
#gelen-banner button { background: #fff; color: #d97706; border: 0; border-radius: 8px; padding: 6px 12px; }
.form-sel { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 4px; }
