* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f6f7fb;
  color: #111;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px;
}
.topbar h1 { margin: 0 0 10px; font-size: 20px; }

.container { max-width: 980px; margin: 18px auto; padding: 0 16px; }

.tabs { display: flex; gap: 8px; }
.tab {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.tab.is-active { border-color: #111; }

.view { padding: 8px 0; }
.hidden { display: none; }

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.row { display: flex; align-items: center; }
.space-between { justify-content: space-between; }
.gap { gap: 10px; }

.btn {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.btn.primary {
  border-color: #111;
  background: #111;
  color: #fff;
}
.btn.danger {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}

/* Better clickability + focus */
.btn, .tab {
  transition: transform 0.06s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:hover, .tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.10);
}
.btn:active, .tab:active {
  transform: translateY(0px);
  box-shadow: 0 2px 6px rgba(0,0,0,.10);
}
.btn:focus-visible, .tab:focus-visible {
  outline: 3px solid rgba(0,0,0,.25);
  outline-offset: 2px;
}
.btn { font-weight: 600; }

.pagesize {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
  font-weight: 600;
}
.pagesize select {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table th, .table td { padding: 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
.table th { text-align: left; font-size: 13px; color: #374151; }
.right { text-align: right; }

.table th:nth-child(1),
.table td:nth-child(1) { width: 140px; }

.table th:nth-child(2),
.table td:nth-child(2) { width: 35%; }

.table th:nth-child(3),
.table td:nth-child(3) { width: 25%; }

.table th:nth-child(4),
.table td:nth-child(4) { width: 10%; text-align: right; }

.table th:nth-child(5),
.table td:nth-child(5) { width: 20%; text-align: right; }

.thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  display: block;
}

.form label { display: block; margin-bottom: 12px; }
.form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  margin-top: 6px;
}
.req { color: #ef4444; }
.muted { color: #6b7280; }

.msg { margin-top: 10px; padding: 10px; border-radius: 10px; background: #f3f4f6; }
.footer { padding: 14px 16px; text-align: center; }

/* Controls (filter/search/sort) */
.controls { margin: 12px 0; }
.controls-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.control {
  display: block;
  color: #374151;
  font-weight: 700;
  font-size: 13px;
}
.control input,
.control select {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
}

.control.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .controls-grid {
    grid-template-columns: 1fr 1fr;
  }
  .control.actions {
    grid-column: span 2;
    justify-content: stretch;
  }
  .control.actions .btn {
    width: 100%;
  }
}