/* ════════════════════════════════════════════════════════════
   Namaz Takip — Tasarım Sistemi (Yeni)
   ════════════════════════════════════════════════════════════ */

:root {
  --accent:       #41603A;
  --accent-h:     #354f2e;
  --accent-soft:  #E1EADD;
  --leaf:         #6FA35C;
  --leaf-h:       #5E8F4C;
  --accent-ring:  rgba(65,96,58,0.18);

  --late:         #E8B84B;
  --late-bg:      color-mix(in srgb, #E8B84B 18%, white);
  --late-border:  color-mix(in srgb, #E8B84B 48%, white);
  --late-text:    color-mix(in srgb, #E8B84B 64%, black);

  --missed:       #BF5B4B;
  --missed-bg:    color-mix(in srgb, #BF5B4B 16%, white);
  --missed-border:color-mix(in srgb, #BF5B4B 42%, white);
  --missed-text:  color-mix(in srgb, #BF5B4B 62%, black);

  --gold:         #D4AF37;

  --ink:          #26312A;
  --ink-2:        #5A6152;
  --muted:        #8C9486;
  --faint:        #9AA295;

  --bg:           #EDEFE9;
  --surface:      #FFFFFF;
  --line:         #E4E7DE;
  --line-2:       #EEF0EA;

  --red:          #BF5B4B;
  --red-soft:     #FBEEEB;
  --red-ink:      #A8453A;
  --green:        #41603A;
  --green-soft:   #E1EADD;
  --green-ink:    #354f2e;
  --amber:        #E8B84B;
  --amber-soft:   #FBF2DA;
  --amber-ink:    #8A6D1E;

  --sh-sm:  0 1px 2px rgba(40,49,42,0.04);
  --sh:     0 2px 10px rgba(40,49,42,0.06);
  --sh-md:  0 4px 16px rgba(40,49,42,0.10);
  --sh-lg:  0 8px 24px rgba(40,49,42,0.12);

  --r-sm:   10px;
  --r:      16px;
  --r-lg:   20px;
  --r-xl:   24px;

  --sidebar-w: 248px;
  --topbar-h:  72px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.hidden { display: none !important; }
.only-mobile { display: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; }
p { margin: 0; }
.muted  { color: var(--muted); }
.small  { font-size: 0.82rem; }
a { color: var(--accent); }

/* ── Açılış ─────────────────────────────────────────────── */
.boot {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); z-index: 50; gap: 24px; grid-auto-flow: row;
}
.boot-logo { color: var(--accent); }
.boot-spin {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Auth ────────────────────────────────────────────────── */
.screen-center {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--accent) 12%, white) 0%, transparent 70%), var(--bg);
}
.auth-card { width: 100%; max-width: 420px; padding: 28px; }
.auth-title { font-size: 1.5rem; margin: 14px 0 4px; }
.auth-foot { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 18px; }
.topbar-mini { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

/* ── Marka ──────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-lg { font-size: 1.05rem; }
.brand-name { font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--accent); color: #fff;
  box-shadow: 0 4px 10px var(--accent-ring);
}
.brand-mark.sm { width: 26px; height: 26px; border-radius: 8px; }

/* ── Kartlar ─────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 18px; box-shadow: var(--sh);
}
.card.elevated { box-shadow: var(--sh-lg); border-color: transparent; }
.card.flat     { box-shadow: none; }
.card-pad-sm   { padding: 14px; }

/* ── Formlar ─────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
label { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 0.95rem; background: #F7F8F4;
  color: var(--ink); font-family: inherit; font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); font-weight: 500; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
input:disabled { opacity: 0.6; cursor: not-allowed; }
.code-input {
  text-transform: uppercase; letter-spacing: 0.45em; text-align: center;
  font-weight: 700; font-size: 1.1rem;
}
.hint  { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.error { color: var(--red); font-size: 0.85rem; min-height: 1.1em; margin: 2px 0 6px; }

/* ── Butonlar ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 0.9rem; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
  white-space: nowrap;
}
.btn:hover   { background: var(--line-2); }
.btn:active  { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 6px 16px var(--accent-ring);
}
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.success { background: var(--green); color: #fff; border-color: var(--green); }
.btn.success:hover { background: var(--green-ink); }
.btn.danger  { background: var(--red-soft); color: var(--red-ink); border-color: color-mix(in srgb, #BF5B4B 30%, white); }
.btn.danger:hover { background: color-mix(in srgb, #BF5B4B 24%, white); }
.btn.ghost   { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line-2); }
.btn.btn-block { width: 100%; }
.btn.btn-sm    { padding: 8px 13px; font-size: 0.83rem; }
.btn.btn-xs    { padding: 5px 9px; font-size: 0.76rem; border-radius: 8px; gap: 5px; }
.btn-row       { display: flex; gap: 10px; flex-wrap: wrap; }

.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 4px 2px; font-size: 0.88rem; font-weight: 700; font-family: inherit; }
.link-btn:hover { color: var(--accent-h); text-decoration: underline; }
.link-right { align-self: flex-end; margin: -6px 0 8px; }

.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--ink-2); cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--line-2); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); margin: 18px 0; font-size: 0.8rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Rozetler ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.badge.role-badge { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.green  { background: var(--green-soft); color: var(--green-ink); border-color: transparent; }
.badge.amber  { background: var(--amber-soft); color: var(--amber-ink); border-color: transparent; }
.badge.red    { background: var(--red-soft);   color: var(--red-ink);   border-color: transparent; }
.badge.gray   { background: var(--line-2); color: var(--muted); }

/* ════════════════════════════════════════════════════════════
   UYGULAMA KABUĞU
   ════════════════════════════════════════════════════════════ */
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* ── Kenar çubuğu ─────────────────────────────────────────── */
.sidebar {
  position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line);
  background: var(--surface); display: flex; flex-direction: column; padding: 16px 12px;
  z-index: 30;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 800; }
.group-switch  { padding: 0 8px 12px; }
.group-switch label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); margin-bottom: 5px; }
.select-sm { padding: 8px 10px; font-size: 0.85rem; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; padding: 4px 0; }
.nav-section { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 700; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 700; font-size: 0.9rem; cursor: pointer; border: none;
  background: none; font-family: inherit; text-align: left; width: 100%; transition: background .12s, color .12s;
}
.nav-item svg    { flex: none; opacity: 0.8; }
.nav-item:hover  { background: var(--line-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-count { margin-left: auto; font-size: 0.72rem; background: var(--line); color: var(--muted); padding: 1px 7px; border-radius: 999px; font-weight: 700; }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.user-card  { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.user-meta  { min-width: 0; }
.user-name  { display: block; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.avatar {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 0.85rem; flex: none; letter-spacing: 0.5px;
}
.avatar.lg { width: 62px; height: 62px; font-size: 1.35rem; border-radius: 20px; }
/* Masaüstünde kenar çubuğu sabit olduğu için topbar avatarı menü açmaz */
.topbar-avatar { cursor: default; }

/* ── Ana alan ─────────────────────────────────────────────── */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: rgba(237,239,233,0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
/* Başlığını kendi içinde gösteren görünümlerde (Bugün) topbar hiç çizilmez,
   böylece içerik sayfanın en üstünden başlar */
.topbar.bare { display: none; }
.topbar.bare + .view { padding-top: 8px; }
.topbar-left  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar-titles { min-width: 0; }
.page-title { font-size: 1.15rem; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-sub   { font-size: 0.78rem; color: var(--muted); font-weight: 500; margin-top: 1px; }

.view { padding: 16px 22px 24px; max-width: 680px; width: 100%; margin: 0 auto; }
.view-section { margin-bottom: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-title { font-size: 1rem; font-weight: 800; color: var(--ink); }

/* ── KPI kartları ─────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 8px;
}
.stat-top   { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.stat-icon  { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber-ink); }
.stat-icon.green { background: var(--accent-soft); color: var(--accent); }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin-top: 4px; }
.stat-sub   { font-size: 0.7rem; color: var(--faint); font-weight: 500; margin-top: -2px; }

/* ── Özet kart (bugün) ────────────────────────────────────── */
/* Beyaz kart + içeride yeşil çerçeve (border yerine inset gölge, böylece
   çerçeve kartın kenarından biraz içeride duruyor) */
.summary-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 18px; display: flex; align-items: center; gap: 16px; box-shadow: var(--sh);
  position: relative;
}
.summary-card::before {
  content: ""; position: absolute; inset: 6px;
  border: 1.5px solid color-mix(in srgb, var(--leaf) 70%, white);
  border-radius: calc(var(--r-xl) - 7px); pointer-events: none;
}
.ring-wrap { position: relative; width: 64px; height: 64px; flex: none; }
.ring-wrap svg { display: block; }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-count { font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1; }
.ring-of    { font-size: 10px; color: var(--faint); font-weight: 700; }
.summary-info { flex: 1; min-width: 0; }
.summary-progress { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.summary-title { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin-top: 6px; letter-spacing: -0.01em; }
.summary-date  { font-size: 0.78rem; font-weight: 500; color: var(--muted); margin-top: 1px; }
.streak-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  height: 28px; padding: 0 11px; border-radius: 999px;
  background: var(--amber-soft); color: var(--amber-ink); font-size: 12.5px; font-weight: 700;
}

/* ── Namaz satırları (yeni slider tasarım) ─────────────────── */
.prayer-list { display: flex; flex-direction: column; gap: 11px; }

.prayer-row {
  position: relative; height: 66px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
  user-select: none; -webkit-user-select: none;
}
.prayer-row.is-green {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.prayer-row.is-yellow {
  background: var(--late-bg); border-color: var(--late-border);
}
.prayer-row.is-red {
  background: var(--missed-bg); border-color: var(--missed-border);
}
.prayer-row.is-tesbih {
  background: var(--accent);
  border-color: #D4AF37;
  box-shadow: 0 0 0 1px #D4AF37, 0 0 8px 2px #D4AF3799, 0 0 20px 6px #D4AF3744;
}
.prayer-row.is-gold {
  background: #D4AF37;
  border-color: #D4AF37;
  box-shadow: 0 0 0 1px var(--accent), 0 0 8px 2px #41603A99, 0 0 20px 6px #41603A44;
}

/* fill overlay while dragging */
.prayer-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent); opacity: 0;
  pointer-events: none; z-index: 1; border-radius: var(--r-lg);
  transition: opacity .2s ease;
}
.prayer-fill.dragging { opacity: 0.16; transition: none; }

/* name + time in the middle */
.prayer-content {
  position: absolute; inset: 0; padding-left: 78px; padding-right: 128px;
  display: flex; align-items: center; gap: 12px; pointer-events: none; z-index: 2;
}
.prayer-name { font-size: 17px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.prayer-row.is-green .prayer-name,
.prayer-row.is-tesbih .prayer-name { color: #fff; }
.prayer-row.is-gold .prayer-name   { color: #5A4416; }
.prayer-row.is-yellow .prayer-name { color: var(--late-text); }
.prayer-row.is-red .prayer-name    { color: var(--missed-text); }
.prayer-time { font-size: 14px; font-weight: 500; color: var(--faint); }
.prayer-row.is-green .prayer-time { display: none; }

/* kaza/missed chip on right */
.prayer-kaza-zone {
  position: absolute; right: 10px; top: 8px; bottom: 8px;
  display: none; align-items: center;
  background: none; border: none; padding: 0; cursor: pointer; z-index: 3;
}
.prayer-row.is-yellow .prayer-kaza-zone,
.prayer-row.is-red .prayer-kaza-zone { display: flex; }
.kaza-chip {
  display: flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 13px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.kaza-chip.yellow { background: var(--late); color: color-mix(in srgb, var(--late) 64%, black); }
.kaza-chip.red    { background: var(--missed); color: #fff; }

/* knob */
.prayer-knob {
  position: absolute; top: calc(50% - 27px);
  width: 54px; height: 54px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(40,49,42,0.18);
  display: flex; align-items: center; justify-content: center;
  cursor: grab; touch-action: none; z-index: 4;
  transition: left .32s cubic-bezier(0.34,1.3,0.64,1), border-color .2s ease;
}
.prayer-knob:active { cursor: grabbing; }

/* ── Lejant ─────────────────────────────────────────────── */
.legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 0; }
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.leg-dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }

/* ── Aksiyon çubuğu (bugün) ─────────────────────────────── */
.action-bar { padding: 8px 0 4px; }
.action-bar-inner { display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-complete-all {
  flex: 0 1 240px; display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 58px; border-radius: var(--r-lg); border: none; cursor: pointer;
  background: var(--leaf); color: #fff; font-size: 16px; font-weight: 700;
  font-family: inherit; box-shadow: 0 10px 24px color-mix(in srgb, var(--leaf) 40%, transparent);
  transition: transform .12s ease, background .15s ease;
}
.btn-complete-all:hover  { background: var(--leaf-h); }
.btn-complete-all:active { transform: scale(0.98); }
.btn-undo {
  width: 58px; height: 58px; flex: none; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .12s ease, opacity .18s ease;
}
.btn-undo:active { transform: scale(0.95); }
.btn-undo:disabled { opacity: 0.35; cursor: default; }

/* ── İlerleme çubuğu ────────────────────────────────────── */
.bar { height: 10px; background: rgba(40,49,42,0.06); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }

/* ── Mini grafik (istatistik) ───────────────────────────── */
.week-chart {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 8px; height: 130px; margin-top: 16px;
}
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; height: 100%; }
.chart-col-score { font-size: 11px; font-weight: 700; color: var(--muted); }
.chart-track {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  border-radius: 8px; background: rgba(40,49,42,0.05); overflow: hidden;
}
.chart-bar { width: 100%; background: var(--accent); border-radius: 8px; transition: height .3s ease; }
.chart-bar.low { background: var(--late); }
.chart-x { font-size: 10.5px; font-weight: 600; color: var(--faint); }

/* ── Geçmiş liste ───────────────────────────────────────── */
.history-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 8px 16px; box-shadow: var(--sh); }
.history-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 2px;
  border-bottom: 1px solid var(--line-2);
}
.history-row:last-child { border-bottom: none; }
.history-info { flex: 1; min-width: 0; }
.history-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.history-sub   { font-size: 12px; font-weight: 500; color: var(--faint); }
.history-dots  { display: flex; gap: 5px; flex: none; }
.h-dot { width: 9px; height: 9px; border-radius: 999px; }

/* ── Vakit dağılım çubuğu ─────────────────────────────── */
.breakdown-row { display: flex; align-items: center; gap: 12px; }
.breakdown-name { width: 58px; font-size: 14px; font-weight: 700; color: var(--ink); flex: none; }
.breakdown-bar-track { flex: 1; height: 10px; border-radius: 999px; background: rgba(40,49,42,0.06); overflow: hidden; }
.breakdown-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.breakdown-pct { width: 42px; text-align: right; font-size: 13px; font-weight: 700; color: var(--ink-2); flex: none; }

/* ── Profil ─────────────────────────────────────────────── */
.profile-hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--sh);
}

/* ── Toast ──────────────────────────────────────────────── */
.toast-host { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; background: var(--ink); color: #fff;
  padding: 11px 16px; border-radius: 999px; font-size: 0.86rem; font-weight: 700;
  box-shadow: var(--sh-lg); animation: toastIn .25s ease; white-space: nowrap;
}
.toast.success { background: var(--green-ink); }
.toast.error   { background: var(--red-ink); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ── Modal ─────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 40; backdrop-filter: blur(2px); }
.modal-host { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.modal { pointer-events: auto; width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: 24px; animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal h2 { font-size: 1.15rem; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ── Seri alevleri (başlık eki) ──────────────────────────── */
.page-extra { margin-left: auto; flex: none; }
.flame-row {
  display: flex; align-items: flex-end; gap: 12px; padding: 4px 6px;
  border: none; background: none; cursor: pointer; font-family: inherit;
  border-radius: 12px; transition: background .15s;
}
.flame-row:hover  { background: var(--line-2); }
.flame-row:active { transform: scale(0.96); }
.flame-item  { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.flame-icon  { display: block; line-height: 0; }
.flame-value { font-size: 0.72rem; font-weight: 800; color: var(--ink-2); line-height: 1; }

/* seri detay modalı */
.streak-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.streak-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--line-2);
}
.streak-flame { line-height: 0; flex: none; }
.streak-text  { flex: 1; min-width: 0; }
.streak-label { font-size: 0.86rem; font-weight: 800; color: var(--ink); }
.streak-note  { font-size: 0.72rem; font-weight: 500; color: var(--muted); margin-top: 1px; }
.streak-value { font-size: 0.95rem; font-weight: 800; color: var(--ink); white-space: nowrap; }

/* ── Aylık ısı haritası ──────────────────────────────────── */
.stat-icon-btn {
  border: none; font: inherit; cursor: pointer; position: relative;
  transition: transform .1s ease, box-shadow .15s ease;
  box-shadow: 0 0 0 0 var(--accent-ring);
}
.stat-icon-btn:hover  { box-shadow: 0 0 0 4px var(--accent-ring); }
.stat-icon-btn:active { transform: scale(0.92); }
/* dokunulabilir olduğunu belli eden küçük işaret */
.stat-icon-btn::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); border: 1.5px solid var(--surface);
}

.heat-modal { padding: 18px; max-width: 400px; max-height: calc(100dvh - 40px); overflow-y: auto; }
/* istatistik sayfasındaki geniş kart hâli */
.heat-card { padding: 16px; }
.heat-card .heat-grid { max-width: 520px; }
.heat-card .heat-cell { font-size: 0.82rem; border-radius: 10px; }
.heat-person { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.heat-person-name { font-size: 1rem; font-weight: 800; color: var(--accent); }
.heat-person-id   { font-size: 0.68rem; font-weight: 600; color: var(--faint); overflow-wrap: anywhere; }

.heat-head  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.heat-title { font-size: 1.05rem; font-weight: 800; color: var(--ink); margin: 0; text-align: center; flex: 1; }
.heat-nav-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--ink-2); cursor: pointer; transition: background .15s, opacity .15s;
}
.heat-nav-btn:hover:not(:disabled) { background: var(--line-2); }
.heat-nav-btn:disabled { opacity: 0.32; cursor: default; }

.heat-summary { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 14px; }
.heat-summary-sub { font-size: 0.78rem; font-weight: 600; color: var(--muted); }

.heat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat-dow  { margin-bottom: 6px; }
.heat-dow-cell { font-size: 0.66rem; font-weight: 700; color: var(--faint); text-align: center; letter-spacing: 0.02em; }

.heat-cell {
  aspect-ratio: 1; width: 100%; border: none; border-radius: 9px; padding: 0;
  font-family: inherit; font-size: 0.76rem; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; color: var(--ink-2);
  background: var(--line-2); transition: transform .08s ease, box-shadow .15s ease;
}
.heat-cell:active { transform: scale(0.9); }
.heat-blank  { background: none; cursor: default; }

/* 0 vakit → nötr, 1-5 → koyulaşan yeşil */
.heat-0 { background: var(--line-2); color: var(--faint); }
.heat-1 { background: color-mix(in srgb, var(--leaf) 20%, white); }
.heat-2 { background: color-mix(in srgb, var(--leaf) 38%, white); }
.heat-3 { background: color-mix(in srgb, var(--leaf) 58%, white); color: #fff; }
.heat-4 { background: color-mix(in srgb, var(--leaf) 80%, white); color: #fff; }
.heat-5 { background: var(--accent); color: #fff; }

/* kayıt girilmiş ama hiç kılınmamış gün — boş günden ayrılsın */
.heat-marked { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--missed) 45%, white); }
.heat-future { background: none; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--faint); cursor: default; }
.heat-today  { box-shadow: 0 0 0 2px var(--accent); }
/* seçim outline ile — böylece bugünün yeşil halkası da görünmeye devam eder */
.heat-cell.is-selected { outline: 2px solid var(--ink); outline-offset: 1px; }

.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 12px; }
.heat-legend-label { font-size: 0.68rem; font-weight: 600; color: var(--faint); }
.heat-swatch { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

.heat-detail {
  margin-top: 14px; padding: 13px; border-radius: var(--r-lg);
  background: var(--line-2); border: 1px solid var(--line);
}
.heat-detail-date  { font-size: 0.82rem; font-weight: 800; color: var(--ink); }
.heat-detail-empty { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.heat-detail-score { font-size: 0.74rem; font-weight: 700; color: var(--muted); margin-top: 9px; }
.heat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.heat-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 0.72rem; font-weight: 700; color: var(--ink-2);
}
.heat-chip.is-empty { opacity: 0.6; }
.heat-chip-dot   { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.heat-chip-state { font-weight: 600; color: var(--faint); }

/* ── Tablo / çizelge ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
.table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 700; background: var(--line-2); position: sticky; top: 0; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--line-2); }
.table .col-c { text-align: center; }
.table .name-cell { font-weight: 700; }
.name-with-avatar { display: flex; align-items: center; gap: 10px; }
.table th:first-child, .table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table th:first-child { z-index: 2; background: var(--line-2); }
.table tbody tr:hover td:first-child { background: var(--line-2); }

.cell { width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid var(--line); cursor: pointer; transition: transform .06s; display: inline-grid; place-items: center; background: var(--surface); }
.cell:active:not(:disabled) { transform: scale(0.92); }
.cell:disabled { cursor: default; }
.cell.empty::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #D7DBD0; }
.cell.green  { background: var(--accent); border-color: var(--accent); }
.cell.yellow { background: var(--amber);  border-color: var(--amber); }
.cell.red    { background: var(--missed); border-color: var(--missed); }
.cell.green::after, .cell.yellow::after, .cell.red::after { content: "✓"; color: #fff; font-size: 0.85rem; font-weight: 800; }
.cell.yellow::after { content: "~"; }
.cell.red::after    { content: "✕"; }

.score-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.82rem; }

/* ── Segment / tarih ────────────────────────────────────── */
.segmented { display: inline-flex; background: var(--line-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.segmented button { border: none; background: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 0.84rem; color: var(--muted); cursor: pointer; font-family: inherit; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }
.date-nav { display: inline-flex; align-items: center; gap: 8px; }
.date-nav .date-label { font-weight: 700; min-width: 150px; text-align: center; }
.date-input-inline { width: auto; padding: 8px 10px; }

/* ── Boş / yükleniyor ────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 14px; background: var(--line-2); color: var(--faint); }
.empty-state h3 { color: var(--ink-2); font-size: 1rem; margin-bottom: 4px; font-weight: 800; }
.skeleton { background: linear-gradient(90deg, var(--line-2) 25%, var(--surface) 37%, var(--line-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.spinner-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Mobil alt nav ───────────────────────────────────────── */
.bottomnav { display: none; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — MOBİL
   ════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .only-mobile  { display: grid; }
  .app-shell    { grid-template-columns: 1fr; }
  /* Mobilde kenar çubuğu yok — gezinme alt çubuktan ve Profil sekmesinden */
  .sidebar { display: none; }

  .topbar { padding: 0 16px; height: var(--topbar-h); }
  .view   { padding: 14px 16px 100px; }

  /* Floating pill bottom nav */
  .bottomnav {
    display: flex; position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 35;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 30px; box-shadow: 0 8px 24px rgba(40,49,42,0.12);
    padding: 0 14px; height: 64px; align-items: center; justify-content: space-around;
  }
  .bottomnav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: none; background: none; color: var(--faint); cursor: pointer;
    font-family: inherit; padding: 0; width: 44px; height: 44px; border-radius: 14px;
    transition: color .15s;
  }
  .bottomnav-item.active { color: var(--accent); }
  .bottomnav-item svg    { opacity: 0.85; }
  .bottomnav-item.active svg { opacity: 1; }

  /* Center + button in bottom nav */
  .bottomnav-center {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 999px;
    background: var(--accent); border: none; cursor: pointer;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent);
    margin-top: -20px; flex: none; color: #fff;
    transition: background .15s, transform .1s;
  }
  .bottomnav-center:active { transform: scale(0.94); }
}

@media (min-width: 901px) {
  .sidebar { transform: none !important; }
}

@media (max-width: 480px) {
  .auth-card { padding: 20px; }
  .stat-value { font-size: 1.45rem; }
  .table th, .table td { padding: 9px 8px; }
  .cell { width: 32px; height: 32px; }
}

@media (max-width: 560px) {
  .table-wrap:has(.grid-table) { border: none; background: transparent; overflow: visible; }
  .grid-table, .grid-table tbody { display: block; }
  .grid-table thead { display: none; }
  .grid-table tr {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 10px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-xl); padding: 14px; margin-bottom: 12px;
  }
  .grid-table tr:hover { background: var(--surface); }
  .grid-table td:first-child, .grid-table th:first-child { position: static; }
  .grid-table td { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0; border: none; }
  .grid-table td:first-child { grid-column: 1 / -1; padding-bottom: 10px; margin-bottom: 2px; border-bottom: 1px solid var(--line-2); }
  .grid-table td[data-label]::before { content: attr(data-label); font-size: 0.78rem; font-weight: 600; color: var(--muted); }
  .grid-table td.grid-actions { grid-column: 1 / -1; padding-top: 6px; }
  .grid-table td.grid-actions .btn-row { width: 100%; }
  .grid-table td.grid-actions .btn { flex: 1; }
}
