/* admin.css - admin console (/admin). Reuses tokens from styles.css. */

/* .auth-primary/.auth-secondary (account.css) are sized for the narrow
   login card they were built for (width:100%) -- constrain them back
   down to a normal button width here, inside the wider .simple-page
   "Admin only" denial state. */
.admin-login-btn {
  width: auto;
  margin: 0 0 20px;
  padding: 12px 28px;
}

.admin-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.admin-section {
  margin-top: 32px;
}

.admin-section-title {
  font-family: Georgia, serif;
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--text);
}

.admin-section-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}

/* -- Games ---------------------------------------------------------------- */

.admin-games {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-game-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.admin-game-glyph {
  font-size: 24px;
  flex-shrink: 0;
}

.admin-game-info {
  flex: 1;
  min-width: 0;
}

.admin-game-title {
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
}

.admin-game-desc {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.admin-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background .15s ease;
}

.admin-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}

.admin-toggle input:checked + .admin-toggle-track {
  background: var(--accent);
}

.admin-toggle input:checked + .admin-toggle-track .admin-toggle-thumb {
  transform: translateX(18px);
}

.admin-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 52px;
}

/* -- Sliders image manager --------------------------------------------------- */

.admin-puzzle-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-puzzle-upload input[type="text"] {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.admin-puzzle-upload input[type="file"] {
  flex: 1 1 200px;
  min-width: 160px;
  font-size: 12.5px;
  color: var(--muted);
}

.admin-puzzle-upload-msg {
  flex-basis: 100%;
  font-size: 12.5px;
  color: var(--muted);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.admin-tab {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-puzzle-thumb {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.admin-puzzle-title {
  font-weight: 600;
  color: var(--text);
}

.admin-puzzle-owner {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.admin-puzzle-private {
  color: var(--muted);
  font-size: 12px;
}

.admin-toggle-compact .admin-toggle-track {
  width: 34px;
  height: 19px;
}

.admin-toggle-compact .admin-toggle-thumb {
  width: 15px;
  height: 15px;
}

.admin-toggle-compact input:checked + .admin-toggle-track .admin-toggle-thumb {
  transform: translateX(15px);
}

.admin-puzzle-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.admin-puzzle-delete:hover {
  border-color: #b6432a;
  color: #b6432a;
}

/* -- Database maintenance (backup/restore) ---------------------------------- */

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.admin-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-btn-danger {
  border-color: #b6432a;
  color: #b6432a;
}

.admin-btn-danger:hover {
  background: #b6432a;
  color: #fff;
}

.admin-db-row {
  margin-bottom: 16px;
}

.admin-db-restore-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-db-restore-form input[type="file"] {
  flex: 1 1 200px;
  min-width: 160px;
  font-size: 12.5px;
  color: var(--muted);
}

.admin-inline-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.admin-db-restore-msg {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: pre-wrap;
}

/* -- Users table ------------------------------------------------------------ */

.admin-table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .06em;
  font-weight: 600;
}

.admin-table tr:last-child td {
  border-bottom: none;
}
