@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2431;
  --border: #262f3d;
  --text: #e6e8eb;
  --text-dim: #8b93a1;
  --accent: #37b6a3;
  --accent-dim: #1f4d47;
  --danger: #e5534b;
  --danger-dim: #3a201f;
  --success: #3fb950;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: 78px;
}

#app { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

main#content {
  padding: 14px 14px 20px;
}

/* ---------- دکمه‌های عمومی ---------- */
button {
  font-family: inherit;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #06231f;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  width: 100%;
}
.btn-primary:disabled { opacity: .5; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger-dim);
  color: #ffb4af;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

/* ---------- کارت تسک ---------- */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 10px;
}
.task-card.overdue { border-inline-start-color: var(--danger); }
.task-card.done { border-inline-start-color: var(--success); opacity: .75; }

.task-title {
  font-weight: 700;
  font-size: 14.5px;
  margin: 0 0 6px;
  line-height: 1.5;
}
.task-title .task-id { color: var(--text-dim); font-weight: 400; font-size: 12px; }

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.chip.overdue { background: var(--danger-dim); color: #ffb4af; border-color: transparent; }
.chip.done { background: #16301c; color: #7ee08a; border-color: transparent; }
.chip.recurring { background: #1c2b3a; color: #7cc4ff; border-color: transparent; }

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.task-actions button {
  flex: 1;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 12.5px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.task-actions button.done-btn { background: var(--accent-dim); color: #8fe8d8; border-color: transparent; }

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
  font-size: 14px;
}

.section-label {
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 700;
  margin: 18px 2px 8px;
}
.section-label:first-child { margin-top: 2px; }

/* ---------- فرم ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.field textarea { resize: vertical; min-height: 70px; }

.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
}
.pill.selected { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ---------- لیست اعضا ---------- */
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 9px;
}
.member-row .name { font-weight: 700; font-size: 14px; }
.member-row .badge-admin {
  font-size: 11px;
  color: var(--accent);
  margin-inline-start: 6px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
}
.filter-tabs button {
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
}
.filter-tabs button.active { background: var(--accent); color: #06231f; font-weight: 700; border-color: transparent; }

/* ---------- مودال ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 20;
  display: flex;
  align-items: flex-end;
}
.modal-sheet {
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 18px;
  border-top: 1px solid var(--border);
}
.modal-sheet h2 { font-size: 16px; margin: 0 0 14px; }
.modal-close {
  position: sticky;
  top: 0;
  float: left;
  background: var(--surface-2);
  color: var(--text-dim);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px;
}

.comment-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.comment-item .author { font-weight: 700; font-size: 12.5px; color: var(--accent); }
.comment-item .when { font-size: 11px; color: var(--text-dim); margin-inline-start: 6px; }
.comment-item .body { font-size: 13.5px; margin-top: 5px; line-height: 1.6; }

/* ---------- ناوبری پایین ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.nav-btn {
  flex: 1;
  background: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 6px 2px;
  border-radius: 10px;
}
.nav-btn.active { color: var(--accent); }
.nav-icon { font-size: 19px; }
.nav-btn.admin-only { display: none; }
body.is-admin .nav-btn.admin-only { display: flex; }

.loading {
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
  font-size: 13px;
}
