/* ── App Shell ──────────────────────────────────────────────────── */
.checklist-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 60px);
  background: var(--cream);
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--cream-dark);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--cream-dark);
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.btn-new {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-body);
}
.btn-new:hover { background: var(--navy-mid); }

.checklist-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-empty {
  padding: 20px;
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.checklist-item:hover { background: var(--cream); }
.checklist-item.active {
  background: var(--cream);
  border-left-color: var(--amber);
}

.checklist-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

.checklist-delete {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  border-radius: 3px;
  flex-shrink: 0;
}
.checklist-item:hover .checklist-delete { opacity: 1; }
.checklist-delete:hover { color: #c0392b; background: #fdecea; }

/* ── Main ─────────────────────────────────────────────────────────── */
.checklist-main {
  overflow-y: auto;
}

.checklist-view {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 32px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-light);
  font-size: 15px;
}

.empty-icon {
  color: var(--cream-dark);
}

/* ── Checklist Header ─────────────────────────────────────────────── */
.checklist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.checklist-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.checklist-meta {
  font-size: 14px;
  color: var(--text-light);
}

.btn-edit-title {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 4px;
  transition: background 0.15s, color 0.15s;
}
.btn-edit-title:hover { background: var(--cream-dark); color: var(--navy); }

/* ── Title Edit ───────────────────────────────────────────────────── */
.title-edit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.title-edit-input {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  border: none;
  border-bottom: 2px solid var(--amber);
  background: transparent;
  flex: 1;
  padding: 4px 0;
  outline: none;
}
.btn-save-title {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.btn-cancel-edit {
  background: none;
  border: 1px solid var(--cream-dark);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-light);
}

/* ── Progress Bar ─────────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--cream-dark);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 28px;
}
.progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── Items ────────────────────────────────────────────────────────── */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.item:hover { border-color: var(--amber); box-shadow: 0 2px 8px rgba(232,168,54,0.1); }
.item.item-done { background: #f8faf8; border-color: #d4edda; }

.item-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--cream-dark);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  color: var(--white);
}
.item-check:hover { border-color: var(--amber); }
.item-check.checked { background: var(--navy); border-color: var(--navy); }

.item-text {
  flex: 1;
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.5;
}
.item.item-done .item-text {
  text-decoration: line-through;
  color: var(--text-light);
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.item-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--cream-dark);
  cursor: pointer;
}

.btn-photo {
  background: none;
  border: 1px solid var(--cream-dark);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  transition: border-color 0.15s, color 0.15s;
}
.btn-photo:hover { border-color: var(--amber); color: var(--navy); }

.btn-delete-item {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.item:hover .btn-delete-item { opacity: 1; }
.btn-delete-item:hover { color: #c0392b; }

/* ── Add Item ─────────────────────────────────────────────────────── */
.add-item-wrap {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}

.add-item-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}
.add-item-input:focus { border-color: var(--amber); }
.add-item-input::placeholder { color: var(--text-light); }

.btn-add-item {
  padding: 12px 20px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-add-item:hover { background: var(--navy-mid); }

/* ── All Done Badge ───────────────────────────────────────────────── */
.all-done-badge {
  text-align: center;
  padding: 20px;
  background: #f0f7f0;
  border: 1px solid #b7dfb7;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  color: #2d6a2d;
  margin-top: 8px;
}

/* ── Modal ────────────────────────────────────────────────────────── */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,22,40,0.4);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: 8px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(10,22,40,0.2);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dark);
  background: var(--cream);
  outline: none;
  margin-bottom: 20px;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--amber); }
.modal-input::placeholder { color: var(--text-light); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  background: none;
  border: 1px solid var(--cream-dark);
  border-radius: 4px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-mid);
  cursor: pointer;
}
.btn-cancel:hover { border-color: var(--text-light); }

.btn-primary {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--navy-mid); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .checklist-app { grid-template-columns: 1fr; }
  .sidebar { max-height: 220px; border-right: none; border-bottom: 1px solid var(--cream-dark); }
  .checklist-view { padding: 24px 16px; }
  .checklist-title { font-size: 22px; }
}

@media (max-width: 480px) {
  .checklist-view { padding: 20px 12px; }
  .item { padding: 12px 10px; }
  .add-item-wrap { flex-direction: column; }
  .btn-add-item { width: 100%; text-align: center; }
}