:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bar: #1f2933;
  --bar-text: #ffffff;
  --accent: #f5a524;
  --accent-text: #1f2933;
  --ok: #15803d;
  --warn: #c2410c;
  --danger: #b91c1c;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --card: #1f2937;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --line: #374151;
    --bar: #0b1220;
    --ok: #4ade80;
    --warn: #fb923c;
    --danger: #f87171;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + var(--safe-b));
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 22px 0 10px; }
.card h2 { margin-top: 0; }

/* Üst çubuk */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--bar); color: var(--bar-text);
}
.topbar h1 { flex: 1; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; text-decoration: none; font-size: 1.4rem;
  background: rgba(255,255,255,.08);
}
.logo { width: 32px; height: 32px; border-radius: 8px; background: url(../icons/icon.svg) center/cover; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

/* Alt sekme çubuğu (mobil uygulama hissi) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + var(--safe-b));
  background: var(--card); border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; font-size: .72rem; text-decoration: none; color: var(--muted);
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--text); font-weight: 600; }
.tabbar a.on svg { stroke: var(--accent); }

/* Kartlar ve listeler */
.card {
  display: block; background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.card.list { padding: 0; overflow: hidden; }
.card.list > * { border-bottom: 1px solid var(--line); }
.card.list > *:last-child { border-bottom: 0; }
.item-link { display: block; padding: 12px 16px; text-decoration: none; }
.item > summary { padding: 12px 16px; cursor: pointer; list-style: none; }
.item > summary::-webkit-details-marker { display: none; }
.item[open] > summary { background: rgba(127,127,127,.06); }
.item > form { padding: 4px 16px 16px; }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 12px; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.pre { white-space: pre-wrap; margin: 0; }
.cat { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 4px 6px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head a { color: var(--muted); font-size: .9rem; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .btn { margin-top: 14px; }
.warn-card { border-left: 4px solid var(--warn); }

.project .progress { margin: 12px 0 8px; }

/* İlerleme */
.progress { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress.thin { height: 6px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s; }

.hero { display: flex; gap: 18px; align-items: center; }
.hero > div:last-child { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ring {
  --p: 0;
  flex: none; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0);
}
.ring span {
  width: 76px; height: 76px; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; font-weight: 700; font-size: 1.3rem;
}

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 600;
  background: rgba(127,127,127,.15); white-space: nowrap;
}
.badge-aktif { background: rgba(21,128,61,.15); color: var(--ok); }
.badge-beklemede { background: rgba(194,65,12,.15); color: var(--warn); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 8px; text-align: center; }
.stats span { display: block; font-size: .75rem; color: var(--muted); }

/* Formlar */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px;
  padding: 12px; font: inherit; font-size: 16px; /* iOS yakınlaştırmasını önler */
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-size: .85rem; color: var(--muted); margin-bottom: 6px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1rem; }
.check input { width: 22px; height: 22px; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth { max-width: 420px; margin: 24px auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: rgba(127,127,127,.15); color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid currentColor; margin-top: 12px; }
.btn-block { width: 100%; margin-bottom: 12px; }
.grid2 .btn-danger { margin-top: 0; }

.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; font-size: .95rem; }
.flash-ok { background: rgba(21,128,61,.12); color: var(--ok); }
.flash-err { background: rgba(185,28,28,.12); color: var(--danger); }

/* İlerleme kaydırıcısı */
.slider { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.slider input { flex: 1; padding: 0; margin: 0; height: 36px; accent-color: var(--accent); background: none; border: 0; }
.slider output { min-width: 52px; text-align: right; font-weight: 700; font-size: 1.2rem; }
.quick { display: flex; gap: 6px; margin-bottom: 10px; }
.quick button {
  flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: .85rem;
}
.item-form .btn { width: 100%; margin-top: 4px; }

/* Hava durumu seçimi */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { margin: 0; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: 8px 12px; border-radius: 99px; color: var(--text);
  border: 1px solid var(--line); background: var(--bg); font-size: .9rem;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

/* Fotoğraflar */
.photo-btn { border: 2px dashed var(--line); background: transparent; }
.thumbs, .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs img, .gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.gallery { margin-bottom: 12px; }

@media (min-width: 600px) {
  .thumbs, .gallery { grid-template-columns: repeat(4, 1fr); }
}
