/* Görev Takip - krem/sade tema */
:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --line: #eee6d6;
  --line-strong: #ddd3bf;
  --ink: #2a2520;
  --muted: #8c8373;
  --muted-2: #a9a08d;
  --primary: #3c6255;
  --primary-dark: #2f4d43;
  --field: #f4efe4;
  --danger: #a3402c;
  --danger-line: #e6cec4;
  --future: #eee6d6;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select { font-family: inherit; }
input, select { font-size: 16px; } /* iOS'ta odaklanınca zoom yapmasın */
::placeholder { color: var(--muted-2); }

.boot { padding: 40px 20px; color: var(--muted); text-align: center; }

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- Genel bileşenler ---------- */

.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  width: 100%;
}
.btn:active { background: var(--primary-dark); }
.btn[disabled] { opacity: .6; cursor: default; }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
}
.btn-small {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-small.danger { color: var(--danger); border-color: var(--danger-line); }

.input, select.input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--ink);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.muted { color: var(--muted); font-size: 13px; }
.tiny { font-size: 11px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wrap-gap { display: flex; gap: 6px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { height: 18px; }

.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--field);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 2px;
  font-size: 13px;
}

/* ---------- Giriş ---------- */

.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 24px;
  text-align: center;
}
.login-title { font-size: 25px; font-weight: 700; margin-bottom: 6px; }
.code-input {
  font-size: 21px;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--ink);
  width: 100%;
}

/* ---------- Başlık ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0 14px;
}
.hello { font-size: 19px; }
.hello strong { font-weight: 700; }

/* ---------- Bildirim banner'ı ---------- */

.banner {
  background: #eef3ee;
  border: 1px solid #cfe0cf;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}
.banner button {
  white-space: nowrap;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
.banner.info { background: #f6f1e6; border-color: var(--line-strong); display: block; }

/* ---------- Haftalık ızgara ---------- */

.grid-scroll {
  height: min(58vh, 420px);
  min-height: 260px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overscroll-behavior: contain;
}
.grid {
  display: grid;
  gap: 2px;
  padding: 6px;
  width: max-content;
  min-width: 100%;
}
.grid-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  color: #6d6656;
  padding-bottom: 4px;
}
.grid-head.week { display: flex; align-items: flex-end; }
.grid-head.activity {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2px 0 4px;
}
.grid-head.activity span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 9px;
}
.wk-btn {
  border: none;
  border-radius: 4px;
  padding: 0;
  height: 32px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
}
.wk-btn.current { background: var(--primary); color: #fff; }
.wk-btn.future { color: #c8bfa9; }
.cell {
  border-radius: 6px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.week-info {
  grid-column: 1 / -1;
  background: var(--field);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin: 2px 0 4px;
}
.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 2px 4px;
  font-size: 11px;
  color: var(--muted);
}
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- Doldur ekranı ---------- */

.fill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.fill-row .name { font-size: 15px; font-weight: 600; }
.fill-row .hint { color: var(--muted-2); font-weight: 400; font-size: 11px; }
.fill-row input[type="number"] {
  width: 84px;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--ink);
}
.fill-row input[type="checkbox"] {
  width: 26px;
  height: 26px;
  accent-color: var(--primary);
}

/* ---------- Admin ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  white-space: nowrap;
  background: none;
  border: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--ink); border-bottom-color: var(--primary); }

.person-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.person-btn {
  flex: 0 0 138px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  text-align: left;
}
.person-btn.selected { border-color: var(--ink); }
.person-btn .sub { font-size: 11px; font-weight: 600; opacity: .9; }

.pill {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 9px;
  gap: 8px;
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
}
.stepper .val {
  min-width: 74px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.stepper .val small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #2a2520;
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 50;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.toast.err { background: #8c2f22; }
