* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #0f1428;
  color: #e8ecff;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: #8eb4ff; }

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.admin-shell.wide {
  max-width: 1400px;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-icon {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  flex-shrink: 0;
}

.admin-nav {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
}

.panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.login-card {
  max-width: 360px;
  margin: 15vh auto 0;
  padding: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.login-card h1 {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.login-card .hint {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 16px;
}

.auth-message p {
  margin-bottom: 16px;
  opacity: 0.9;
}

.auth-denied h1 {
  color: #ff8a8a;
}

.twitch-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #9146ff;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.twitch-button:hover {
  background: #772ce8;
}

.twitch-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  opacity: 0.85;
}

input[type="password"],
input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  margin-bottom: 12px;
}

textarea { min-height: 72px; resize: vertical; }

button,
.btn {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #5b7cfa, #7b5cf6);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  background: rgba(255, 255, 255, 0.1);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
}

.tab.active {
  border-color: rgba(123, 92, 246, 0.6);
  background: rgba(123, 92, 246, 0.2);
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

th { opacity: 0.7; font-weight: 600; }

.gift-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 20px;
}

.gift-form label { margin-bottom: 6px; }

.gift-adjust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.gift-adjust-row input[type="number"] {
  width: 72px;
  margin-bottom: 0;
}

.status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.status-info { background: rgba(91, 124, 250, 0.15); }
.status-success { background: rgba(72, 199, 116, 0.15); }
.status-error { background: rgba(255, 90, 90, 0.15); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.hint {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 12px;
}

.row-actions button {
  padding: 4px 8px;
  font-size: 0.8rem;
  margin-right: 4px;
}

.hidden { display: none !important; }

.img-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}

.img-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #1a2038;
}

.upload-btn {
  font-size: 0.75rem;
  padding: 4px 8px;
  background: #2a3358;
  border-radius: 4px;
  cursor: pointer;
}

.upload-btn:hover { background: #3a4578; }

.stats-cell {
  min-width: 220px;
  vertical-align: top;
}

.stats-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  width: 36px;
  padding: 4px;
  text-align: center;
}

.stat-name {
  flex: 1;
  min-width: 70px;
}

.stat-value {
  flex: 1;
  min-width: 70px;
}

.stat-remove {
  padding: 2px 8px;
  font-size: 1rem;
  line-height: 1;
  background: #4a2040;
}

.stat-add {
  align-self: flex-start;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: #2a3358;
}
