:root {
  --bg: #0f1220;
  --panel: #161a2f;
  --text: #e6e8f0;
  --muted: #9aa3b2;
  --accent: #6c8cff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(
      1200px 800px at -10% -20%,
      #1a2040 0%,
      rgba(26, 32, 64, 0) 60%
    ),
    radial-gradient(900px 600px at 110% 0%, #15233d 0%, rgba(21, 35, 61, 0) 55%),
    var(--bg);
  color: var(--text);
}
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}
.topbar {
  background: var(--panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar .brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}
.brand-text {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.topbar nav {
  float: right;
  display: flex;
  gap: 12px;
  align-items: center;
}
.topbar .link,
.topbar a {
  background: none;
  border: none;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.user {
  color: var(--muted);
}
h1 {
  font-size: 28px;
  margin: 16px 0;
}
form.card,
.card {
  background: var(--panel);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.card.small {
  font-size: 14px;
  color: var(--muted);
}
label {
  display: block;
  margin-bottom: 12px;
}
input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d1020;
  color: var(--text);
}
button {
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--accent);
  border: none;
  color: white;
  cursor: pointer;
  font-weight: 600;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.trigger-label {
  margin-bottom: 8px;
  font-weight: 600;
}
.error {
  color: #ff6c6c;
  margin-bottom: 12px;
}

/* Dashboard polish */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 16px;
}
.page-title {
  font-size: 34px;
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(90deg, #eaf0ff, #8aa3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}
.toolbar {
  margin-left: auto;
}
.search-input {
  width: 280px;
  max-width: 40vw;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0e1425;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-input:focus {
  border-color: rgba(108, 140, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.15);
}

.trigger-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.02)
    )
    var(--panel);
  border: 1px solid rgba(108, 140, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.trigger-card:hover {
  transform: translateY(-4px);
  border-color: rgba(108, 140, 255, 0.34);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}
.trigger-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.kind-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(108, 140, 255, 0.35);
  background: linear-gradient(135deg, #6c8cff33, #6c8cff0a);
}
.kind-icon.overlay {
  border-color: rgba(90, 215, 182, 0.45);
  background: linear-gradient(135deg, #5ad7b633, #5ad7b60a);
}
.kind-icon.obs {
  border-color: rgba(255, 138, 77, 0.5);
  background: linear-gradient(135deg, #ff8a4d33, #ff8a4d0a);
}
.kind-icon.giphy {
  border-color: rgba(205, 124, 255, 0.5);
  background: linear-gradient(135deg, #cd7cff33, #cd7cff0a);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #c9cfdd;
  background: rgba(154, 163, 178, 0.12);
  border: 1px solid rgba(154, 163, 178, 0.28);
  text-transform: capitalize;
}
.badge.viewer {
  color: #cfd7ff;
  background: rgba(108, 140, 255, 0.12);
  border-color: rgba(108, 140, 255, 0.35);
}
.badge.vip {
  color: #ffc4da;
  background: rgba(234, 76, 137, 0.12);
  border-color: rgba(234, 76, 137, 0.35);
}
.badge.moderator {
  color: #c8f4ea;
  background: rgba(90, 215, 182, 0.12);
  border-color: rgba(90, 215, 182, 0.35);
}
.badge.subscriber {
  color: #ffe1b4;
  background: rgba(255, 170, 68, 0.12);
  border-color: rgba(255, 170, 68, 0.35);
}

.trigger-card button {
  width: 100%;
  margin-top: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #6c8cff, #5d79f2);
  box-shadow: 0 6px 16px rgba(92, 116, 255, 0.35);
}
.trigger-card button:hover {
  filter: brightness(1.05);
}
.trigger-card button[disabled] {
  background: #2a2f45;
  color: #9aa3b2;
  box-shadow: none;
  cursor: not-allowed;
}

/* Generic buttons/links */
.button {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: white;
  background: linear-gradient(180deg, #6c8cff, #5d79f2);
  border: 0;
  box-shadow: 0 6px 16px rgba(92, 116, 255, 0.35);
  font-weight: 600;
}
.button:hover {
  filter: brightness(1.05);
}
.button-danger,
button.danger {
  background: linear-gradient(180deg, #ff6c6c, #ff4d4d);
  box-shadow: 0 6px 16px rgba(255, 108, 108, 0.35);
}
.button-danger:hover,
button.danger:hover {
  filter: brightness(1.05);
}

/* Auth + forms */
.narrow {
  max-width: 520px;
  margin: 0 auto;
}
details.card summary {
  cursor: pointer;
  color: var(--text);
}
fieldset {
  border: 1px dashed rgba(154, 163, 178, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
}
legend {
  color: var(--muted);
  padding: 0 6px;
}

/* Tabs */
.tabs {
  margin-top: 8px;
}
.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.tab-btn {
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  font-weight: 600;
}
.tab-btn.active {
  border-color: rgba(108, 140, 255, 0.35);
  background: linear-gradient(135deg, #6c8cff26, #6c8cff0a);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}
.table th {
  color: var(--muted);
  font-weight: 700;
}
.table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Admin redeems section */
.redeems-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.redeem-card {
  position: relative;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.02)
    )
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
}
.redeem-card .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.redeem-card .title {
  font-weight: 700;
  color: var(--text);
}
.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(154, 163, 178, 0.35);
  background: rgba(154, 163, 178, 0.12);
  color: #c9cfdd;
  text-transform: capitalize;
}
.pill.ok {
  color: #c8f4ea;
  background: rgba(90, 215, 182, 0.12);
  border-color: rgba(90, 215, 182, 0.35);
}
.pill.off {
  color: #cbd3e6;
  background: rgba(154, 163, 178, 0.1);
  border-color: rgba(154, 163, 178, 0.28);
}
.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.meta code {
  color: #cfd7ff;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.btn-row {
  display: flex;
  gap: 8px;
}
.inline {
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.switch input {
  display: none;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #2a2f45;
  transition: 0.2s ease;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.switch .slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.2s ease;
}
.switch input:checked + .slider {
  background: linear-gradient(180deg, #6c8cff, #5d79f2);
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
}
