:root {
  color-scheme: dark;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  --bg: #080d17;
  --card: #131a27;
  --text: #e8f0ff;
  --muted: #98a6c6;
  --line: #25324a;
  --primary: #29c75a;
  --primary-ink: #04210d;
  --danger: #ff6c6c;
  --ok: #7de2a2;
  --today: #f4d35e;
  --reminder: #7eb6ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 0% 10%, #0f4825 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 80%, #063057 0%, transparent 65%),
    var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2 { margin: 0; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }

.app {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.guest-body { min-height: 100vh; }

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1.5rem 1rem;
}

@media (max-height: 760px) {
  .login-shell {
    gap: 0.7rem;
    padding: 0.75rem 1rem;
    justify-content: flex-start;
  }
  .brand h1 { font-size: 1.55rem; }
  .brand-icon { width: 44px; height: 44px; margin-bottom: 0.4rem; }
  .login-card { padding: 0.85rem; }
}

.brand { text-align: center; }
.brand h1 { font-size: 2rem; }
.brand-subtitle {
  margin: 0.35rem 0 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin: 0 auto 0.8rem;
  font-weight: 800;
  color: #0f2f17;
  background: linear-gradient(135deg, #9df08f, #2dbb53);
  box-shadow: 0 8px 30px rgba(38, 190, 91, 0.35);
}

.brand-icon.sm {
  width: 40px;
  height: 40px;
  margin: 0;
  font-size: 0.72rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
}

.login-card { width: min(100%, 420px); }
.install-card { width: min(100%, 520px); }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101724;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.topbar-brand strong { display: block; }
.topbar-brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.topbar-nav a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
}

.topbar-nav a.is-active,
.topbar-nav a:hover {
  background: #1a2333;
  border-color: var(--line);
  text-decoration: none;
}

.topbar-meta {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.who {
  display: grid;
  line-height: 1.2;
  font-size: 0.85rem;
}

.who span { color: var(--muted); font-size: 0.75rem; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin: 0.4rem 0 1rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.main-content { min-width: 0; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

input, select, textarea, button { font: inherit; }

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  min-height: 46px;
  background: #232d41;
  color: var(--text);
  width: 100%;
}

textarea { min-height: 120px; resize: vertical; }

.btn {
  border: 1px solid var(--line);
  background: #1a2333;
  border-radius: 10px;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.full { width: 100%; }
.btn.sm { min-height: 36px; padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn.ghost { background: transparent; }
.btn.primary {
  background: linear-gradient(90deg, #8ce77f, #26b74f);
  border-color: #30c557;
  color: var(--primary-ink);
}
.btn.danger {
  border-color: rgba(255, 108, 108, 0.45);
  color: #ff9a9a;
  background: rgba(110, 29, 29, 0.22);
}
.btn:disabled { opacity: 0.7; cursor: default; }

.stack { display: grid; gap: 0.85rem; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.form-grid .full,
.form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.form-split { border: 0; border-top: 1px dashed var(--line); width: 100%; }

.muted { color: var(--muted); margin: 0.25rem 0 0; }

.flash {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
}
.flash.ok { background: rgba(41, 199, 90, 0.14); color: var(--ok); }
.flash.error { background: rgba(255, 108, 108, 0.12); color: #ff9a9a; }

.chip {
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--text);
}
.chip.danger { background: rgba(255, 108, 108, 0.16); color: #ff9a9a; }
.chip.today { background: rgba(244, 211, 94, 0.16); color: var(--today); }
.chip.reminder { background: rgba(126, 182, 255, 0.16); color: var(--reminder); }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
}
.badge.cat { color: #8ddc9e; }
.badge.prio.acil { background: rgba(255, 108, 108, 0.16); color: #ff9a9a; }
.badge.prio.yuksek { background: rgba(244, 163, 94, 0.16); color: #f4a35e; }
.badge.prio.normal { color: var(--muted); }
.badge.prio.dusuk { color: #7b88a4; }
.badge.st.bekliyor { color: var(--reminder); }
.badge.st.devam { color: var(--today); }
.badge.st.bitti { color: var(--ok); }
.badge.overdue { background: rgba(255, 108, 108, 0.16); color: #ff9a9a; }
.badge.today { background: rgba(244, 211, 94, 0.16); color: var(--today); }
.badge.reminder { background: rgba(126, 182, 255, 0.16); color: var(--reminder); }

.task-list { display: grid; gap: 0.75rem; }

.task-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.task-card.is-overdue { box-shadow: inset 3px 0 0 #ff6c6c, 0 20px 50px rgba(0, 0, 0, 0.32); }
.task-card.is-today { box-shadow: inset 3px 0 0 #f4d35e, 0 20px 50px rgba(0, 0, 0, 0.32); }
.task-card.is-reminder:not(.is-overdue):not(.is-today) {
  box-shadow: inset 3px 0 0 #7eb6ff, 0 20px 50px rgba(0, 0, 0, 0.32);
}

.task-title {
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}
.task-title:hover { color: var(--primary); }

.task-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.45rem 0; }
.task-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.status-btn { min-height: 48px; font-size: 0.88rem; }
.status-btn.is-current.bekliyor { border-color: var(--reminder); color: var(--reminder); }
.status-btn.is-current.devam { border-color: var(--today); color: var(--today); }
.status-btn.is-current.bitti { border-color: var(--primary); color: var(--ok); }
.status-actions.large .status-btn { min-height: 56px; font-size: 1rem; }

.task-desc { white-space: pre-wrap; line-height: 1.5; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 0;
}
.detail-grid dt { color: var(--muted); font-size: 0.75rem; }
.detail-grid dd { margin: 0.2rem 0 0; font-weight: 600; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.data-table th { color: var(--muted); font-size: 0.78rem; }

.empty-state { text-align: center; padding: 2rem 1rem; }
.delete-form { margin-top: 0.85rem; }

.feed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
  gap: 0.85rem;
  margin-top: 1rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}

.photo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0d1420;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.photo-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.note-list { display: grid; gap: 0.65rem; }
.note-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #0d1420;
}
.note-item header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}
.note-item p { margin: 0; white-space: pre-wrap; }

.timeline {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.timeline li {
  border-left: 2px solid var(--line);
  padding: 0 0 0.2rem 0.75rem;
}
.timeline time,
.timeline a { display: block; color: var(--muted); font-size: 0.78rem; }
.timeline strong { display: block; font-size: 0.88rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-card strong { display: block; font-size: 2rem; margin: 0.25rem 0; }
.stat-card.overdue strong { color: #ff9a9a; }
.stat-card.today strong { color: var(--today); }
.stat-card.ok strong { color: var(--ok); }
.stat-card a { font-size: 0.8rem; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

@media (min-width: 860px) {
  .task-card {
    grid-template-columns: 1fr 280px;
    align-items: center;
  }
}

@media (max-width: 860px) {
  .feed-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .topbar-meta { width: 100%; }
  .who { margin-right: auto; }
}
