* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Auth screens */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-box {
  background: #16213e;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 380px;
  text-align: center;
}

.auth-box h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: #888;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.auth-box input {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #0d1b2a;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.auth-box input:focus {
  outline: none;
  border-color: #a0c4ff;
}

.auth-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  background: #0f3460;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.2s;
}

.auth-btn:hover {
  opacity: 0.85;
}

.auth-error {
  color: #f44336;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.auth-error.hidden {
  display: none;
}

/* Header */
header {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #16213e;
  border-bottom: 2px solid #0f3460;
}

.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.header-top h1 {
  font-size: 1.5rem;
}

.logout-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid #f44336;
  border-radius: 6px;
  background: transparent;
  color: #f44336;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: #f44336;
  color: #fff;
}

.admin-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid #a0c4ff;
  border-radius: 6px;
  background: transparent;
  color: #a0c4ff;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.admin-btn:hover {
  background: #a0c4ff;
  color: #16213e;
}

.back-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid #888;
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.back-btn:hover {
  border-color: #eee;
  color: #eee;
}

#progress {
  font-size: 1.1rem;
  color: #a0c4ff;
}

/* Admin Screen */
#admin-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

.admin-section {
  background: #16213e;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #a0c4ff;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: start;
}

.admin-form .form-group {
  width: 100%;
}

.admin-form input, .admin-form select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #0d1b2a;
  color: #fff;
  font-size: 1rem;
}

.admin-form .admin-btn {
  height: 44px;
  font-size: 1rem;
  font-weight: 600;
  background: #0f3460;
  border-color: #a0c4ff;
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.user-table th, .user-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #0f3460;
}

.user-table th {
  color: #888;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.user-table tr:nth-child(even) {
  background: #1a1a2e;
}

.user-table .actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

.btn-role {
  border: 1px solid #4caf50;
  color: #4caf50;
  background: transparent;
  cursor: pointer;
}

.btn-role:hover {
  background: #4caf50;
  color: #fff;
}

.btn-delete {
  border: 1px solid #f44336;
  color: #f44336;
  background: transparent;
  cursor: pointer;
}

.btn-delete:hover:not(:disabled) {
  background: #f44336;
  color: #fff;
}

.btn-delete:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #333;
}

.status-badge.pending {
  background: #ff980033;
  color: #ff9800;
}

.status-badge.active {
  background: #4caf5033;
  color: #4caf50;
}

#position {
  font-size: 0.9rem;
  color: #888;
  margin-top: 0.25rem;
}

/* Filters */
#filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #444;
  border-radius: 20px;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: #a0c4ff;
  color: #fff;
}

.filter-btn.active {
  background: #0f3460;
  border-color: #a0c4ff;
  color: #fff;
}

/* Card container — single card centered */
.card-container {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem;
}

/* Card */
.card {
  background: #16213e;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.3s;
  width: 100%;
  max-width: 600px;
}

.card.review-approved {
  border-color: #4caf50;
}

.card.review-useless {
  border-color: #f44336;
}

.card.review-corrected {
  border-color: #ff9800;
}

.card-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #0d1b2a;
  display: block;
}

.card-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #0d1b2a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.9rem;
}

.card-info {
  padding: 1rem;
}

.card-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #fff;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.card-tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  background: #0f3460;
  color: #a0c4ff;
}

.card-description {
  font-size: 0.9rem;
  color: #aaa;
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* Buttons */
.card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.btn {
  flex: 1;
  padding: 0.7rem 0.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  transition: opacity 0.2s;
}

.btn:hover:not(:disabled) {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-useless {
  background: #f44336;
}

.btn-correct {
  background: #ff9800;
}

.btn-approve {
  background: #4caf50;
}

.btn-undo {
  background: #607d8b;
  display: none;
}

.btn-undo.visible {
  display: block;
}

/* End of list message */
.end-message {
  text-align: center;
  padding: 3rem 1rem;
  color: #a0c4ff;
  font-size: 1.2rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #16213e;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 420px;
}

.modal h2 {
  margin-bottom: 1rem;
}

.modal p {
  margin-bottom: 0.75rem;
  color: #aaa;
}

.modal input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #0d1b2a;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.modal input:focus {
  outline: none;
  border-color: #ff9800;
}

.error {
  color: #f44336;
  font-size: 0.85rem;
}

.error.hidden {
  display: none;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-cancel {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-save {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  background: #ff9800;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  background: #f44336;
  color: #fff;
  font-size: 0.9rem;
  z-index: 200;
  transition: opacity 0.3s;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}
