* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f7fb;
  color: #1d2939;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 1px solid #e4e7ec;
  padding: 14px 20px;
}

h1 {
  margin: 0;
  font-size: 22px;
}

.stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 14px;
}

.controls {
  padding: 12px 20px;
}

.control-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

input,
select,
button {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

button {
  cursor: pointer;
  background: #1570ef;
  color: #fff;
  border: none;
}

button:hover {
  background: #175cd3;
}

main {
  padding: 8px 20px 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.card {
  background: #fff;
  border: 1px solid #dce3ef;
  border-radius: 12px;
  padding: 10px;
}

.card.done {
  border-color: #86efac;
}

.card.todo {
  border-color: #f2cbb9;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.name {
  font-size: 13px;
  word-break: break-all;
}

.tick {
  font-weight: 700;
  font-size: 18px;
  min-width: 22px;
  text-align: center;
}

.image-wrap {
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e4e7ec;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.save-form {
  margin-top: 10px;
  display: flex;
  align-items: end;
  gap: 8px;
}

.save-form label {
  flex: 1;
}

.save-status {
  min-width: 62px;
  font-size: 12px;
}

.save-status.ok {
  color: #067647;
}

.save-status.err {
  color: #b42318;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.pagination a {
  color: #175cd3;
  text-decoration: none;
}

.pagination .disabled {
  color: #98a2b3;
}
