:root {
  --bg: #0b1220;
  --bg-soft: #121b2d;
  --card: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.12);
  --text: #eef4ff;
  --muted: #a9b7d0;
  --accent: #6ab4ff;
  --accent-2: #8ff3cb;
  --danger: #ff7f96;
  --shadow: 0 20px 45px rgba(0,0,0,0.24);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(106,180,255,0.16), transparent 30%),
    radial-gradient(circle at top left, rgba(143,243,203,0.10), transparent 30%),
    linear-gradient(180deg, #0a1020 0%, #0f1729 100%);
  min-height: 100vh;
}
* input, * select, * button, * textarea { font: inherit; }
.hero { padding: 56px 20px 28px; }
.hero-inner, main, .admin-layout { max-width: 1180px; margin: 0 auto; }
.auth-hero-inner { min-height: calc(100vh - 84px); display: grid; place-items: center; }
.eyebrow {
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--accent-2);
  margin: 0 0 8px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
}
.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 12px 0 24px;
  max-width: 800px;
}
.title-row, .action-row, .panel-header, .card-actions, .auth-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-link, .back-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  padding: 12px 16px;
  border-radius: 14px;
}
#search, input, select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  color: var(--text);
  outline: none;
}
select option {
  color: #111827;
  background: #ffffff;
}
#search { max-width: 620px; box-shadow: var(--shadow); }
input::placeholder { color: #c3cde0; }
main { padding: 0 20px 48px; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.section-card, .panel, .editor-card, .auth-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.auth-card-wide { width: min(100%, 680px); padding: 30px; }
.section-header h2 { margin-bottom: 4px; font-size: 1.25rem; }
.section-header p { color: var(--muted); min-height: 2.7em; }
.item-list, .stack { display: grid; gap: 12px; }
.item-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 14px 16px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(143,243,203,0.45);
  background: rgba(255,255,255,0.10);
}
.item-title-row, .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.item-title { font-weight: 700; }
.external { color: var(--accent-2); font-size: 1rem; }
.item-desc {
  margin: 8px 0 10px;
  color: var(--muted);
  min-height: 2.6em;
}
.meta-row {
  font-size: .88rem;
  color: #d6e3f7;
}
.meta-row span {
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 6px 10px;
}
.hidden { display: none !important; }
.admin-body { min-height: 100vh; }
.admin-hero { padding-bottom: 18px; }
.admin-layout {
  padding: 0 20px 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.panel-header h2 { margin-bottom: 0; }
.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
label { display: grid; gap: 8px; color: var(--muted); font-size: .95rem; }
.btn {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
}
.btn.primary { background: linear-gradient(180deg, rgba(106,180,255,0.4), rgba(106,180,255,0.22)); }
.btn.ghost { background: rgba(255,255,255,0.06); }
.btn.danger {
  border-color: rgba(255,127,150,0.28);
  background: rgba(255,127,150,0.12);
}
.pill.info { background: rgba(143,243,203,0.12); }
.pill {
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 8px;
}
.status-box {
  margin: 0;
  white-space: pre-wrap;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  color: #dcecff;
}
.error-box {
  color: #ffd8e0;
  background: rgba(255,127,150,0.12);
  border: 1px solid rgba(255,127,150,0.22);
  border-radius: 14px;
  padding: 12px 14px;
}
@media (max-width: 780px) {
  .grid-two { grid-template-columns: 1fr; }
  .section-header p, .item-desc { min-height: auto; }
  .hero { padding-top: 34px; }
}


@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .grid-two { grid-template-columns: 1fr; }
  .section-header p, .item-desc { min-height: auto; }
  .hero { padding-top: 34px; }
  .grid {
    grid-template-columns: 1fr;
  }
  .title-row, .action-row, .panel-header, .card-actions, .auth-footer-row {
    align-items: stretch;
  }
  .btn, .admin-link, .back-link {
    width: 100%;
    text-align: center;
  }
}


.small-note {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.5;
}


.grouped-links-list {
  gap: 18px;
}
.link-group {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 16px;
}
.link-group-header {
  margin-bottom: 12px;
}
.link-group-header h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.link-group-header p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}
.link-group-items {
  gap: 12px;
}

.category-tone-1 {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(106,180,255,0.08));
}
.category-tone-2 {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(120,170,255,0.06));
}


.diagnostics-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
}


.diag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.diag-row:last-child {
  border-bottom: 0;
}
.diag-badge {
  display: inline-block;
  min-width: 88px;
  text-align: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
}
.diag-badge.ok {
  background: rgba(72, 201, 176, 0.18);
  border: 1px solid rgba(72, 201, 176, 0.35);
  color: #b9ffec;
}
.diag-badge.bad {
  background: rgba(255, 127, 150, 0.16);
  border: 1px solid rgba(255, 127, 150, 0.32);
  color: #ffd4dd;
}
.diag-badge.neutral {
  background: rgba(106,180,255,0.14);
  border: 1px solid rgba(106,180,255,0.24);
  color: #d8ebff;
}

/* Stronger but still subtle alternating category tones on frontend */
.section-card.category-tone-1 {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(106,180,255,0.12));
  border-color: rgba(106,180,255,0.22);
}
.section-card.category-tone-2 {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(133,196,255,0.08));
  border-color: rgba(143,243,203,0.18);
}

/* Slightly clearer grouping in admin */
.link-group {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(106,180,255,0.14);
}
.link-group-header {
  padding: 4px 2px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.link-group-header h3 {
  color: #dcecff;
}


.history-list {
  display: grid;
  gap: 12px;
}
.history-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px 16px;
}
.history-main, .history-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.history-main {
  margin-bottom: 6px;
}
.history-type {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  color: var(--accent-2);
}
.history-meta, .history-message {
  color: var(--muted);
  font-size: .9rem;
}

.section-card.category-tone-1 {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(106,180,255,0.18));
  border-color: rgba(106,180,255,0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow);
}
.section-card.category-tone-2 {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(72,140,255,0.14));
  border-color: rgba(72,140,255,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), var(--shadow);
}


#download-sql-backup-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  padding: 6px 2px 2px;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  accent-color: #6ab4ff;
}
.checkbox-row span {
  color: var(--muted);
  font-size: .92rem;
}



/* v26 canonical mobile admin placement */
.mobile-admin-bar {
  display: none;
}

@media (max-width: 780px) {
  /* hide header admin button only on public frontend */
  body:not(.admin-body) > header.hero .title-row > .admin-link {
    display: none !important;
  }

  /* show dedicated bottom admin button after all link boxes */
  body:not(.admin-body) .mobile-admin-bar {
    display: block;
    padding: 0 20px 28px;
  }

  body:not(.admin-body) .mobile-admin-bar .mobile-admin-link {
    display: block !important;
    width: 100%;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.2;
    border-radius: 12px;
  }
}

/* v26 canonical category tones: one authoritative definition at end of CSS */
.section-card.category-tone-1 {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(90,170,255,0.24) 100%) !important;
  border: 1px solid rgba(90,170,255,0.42) !important;
}

.section-card.category-tone-2 {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(45,120,255,0.18) 100%) !important;
  border: 1px solid rgba(45,120,255,0.34) !important;
}

.section-card.category-tone-1 .section-header h2,
.section-card.category-tone-2 .section-header h2 {
  color: var(--text);
}

.section-card.category-tone-1 .section-header p,
.section-card.category-tone-2 .section-header p {
  color: #d7e5fb;
}
