:root {
  --primary: #1e3a8a;
  --primary-d: #172e6e;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px;
}
.hidden { display: none !important; }
.screen { max-width: 640px; margin: 0 auto; min-height: 100%; }

/* --- Giriş --- */
#login { display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 100vh; }
.login-box { background: var(--card); border-radius: 18px; padding: 28px 22px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(2,6,23,.12); }
.login-box h1 { margin: 0; font-size: 22px; color: var(--primary); }
.login-box .sub { margin: 2px 0 20px; color: var(--muted); font-weight: 600; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
input, select { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 16px; background: #fff; }
input:focus, select:focus { outline: none; border-color: var(--primary); }

button { cursor: pointer; border: none; font-family: inherit; }
.primary { background: var(--primary); color: #fff; padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 700; width: 100%; margin-top: 18px; }
.primary:active { background: var(--primary-d); }
.big { padding: 16px; font-size: 17px; }
.link { background: none; color: #fff; font-size: 14px; text-decoration: underline; padding: 6px; }
.err { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 18px; }

/* --- Üst bar --- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--primary); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.hello { font-weight: 700; font-size: 17px; }
.counter { font-size: 13px; opacity: .9; margin-top: 2px; }
.progress { height: 6px; background: #cbd5e1; }
.bar { height: 100%; background: var(--ok); width: 0%; transition: width .3s; }

.toolbar { display: flex; gap: 8px; padding: 12px 16px; position: sticky; top: 58px; background: var(--bg); z-index: 5; }
.toolbar input { flex: 2; } .toolbar select { flex: 1; }

/* --- Liste / kartlar --- */
.liste { padding: 8px 16px 90px; }
.uye { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.uye.geldi { border-color: var(--ok); background: var(--ok-bg); }
.uye .ust { display: flex; align-items: center; gap: 12px; }
.not-satir { margin-top: 10px; }
.not-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fff; }
.not-input:focus { outline: none; border-color: var(--primary); }
.not-satir.dolu .not-input { border-color: var(--primary); background: #f8faff; }
.not-goster { margin-top: 8px; font-size: 13px; color: var(--muted); background: #f8faff; padding: 8px 12px; border-radius: 8px; }
.uye .bilgi { flex: 1; min-width: 0; }
.uye .isim { font-weight: 700; font-size: 16px; }
.uye .alt { font-size: 13px; color: var(--muted); margin-top: 2px; }
.uye .aksiyon { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.btn-ara { background: #e0e7ff; color: var(--primary); padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn-durum { padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; min-width: 108px; text-align: center; border: 2px solid var(--border); background: #fff; color: var(--muted); }
.btn-durum.on { background: var(--ok); color: #fff; border-color: var(--ok); }

.mahalle-baslik { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 4px 6px; }

/* --- Admin --- */
.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 50px; z-index: 5; }
.tab { flex: 1; padding: 14px 4px; background: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabpane { padding: 16px; padding-bottom: 90px; }
.cards { display: flex; gap: 10px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 8px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 800; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.ok .num { color: var(--ok); } .stat.pct .num { color: var(--primary); }
h3 { font-size: 15px; margin: 22px 0 8px; }
.minitable { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.row { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.row:last-child { border-bottom: none; }
.row .r-val { font-weight: 700; }
.row .r-val small { color: var(--muted); font-weight: 500; }
.hint { font-size: 13px; color: var(--muted); background: #eef2ff; padding: 12px; border-radius: 10px; line-height: 1.5; }
.gorevli-kart { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.gorevli-kart .ust { display: flex; justify-content: space-between; align-items: center; }
.kimlik { font-family: monospace; background: #f1f5f9; padding: 6px 10px; border-radius: 8px; font-size: 14px; margin-top: 8px; display: inline-block; }
.mini { padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.mini.kopya { background: #e0e7ff; color: var(--primary); }
.mini.reset { background: #fef3c7; color: #92400e; }
#dosya { margin: 12px 0; }
#yukle-sonuc { margin-top: 16px; font-size: 14px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 12px 20px; border-radius: 24px; font-size: 14px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
