:root {
  --bg: #0c131b;
  --bg-soft: #111925;
  --panel: rgba(24, 33, 46, 0.94);
  --panel-alt: rgba(17, 24, 35, 0.95);
  --panel-strong: rgba(33, 44, 60, 0.98);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef5ff;
  --muted: #a9b7ca;
  --blue: #43c4ff;
  --cyan: #66e5d1;
  --green: #6fe09a;
  --gold: #ffd566;
  --purple: #7b73ff;
  --danger: #ff7d97;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(67, 196, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(123, 115, 255, 0.14), transparent 22%),
    linear-gradient(180deg, #0a1118 0%, #0c141d 45%, #0a1017 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.dashboard-app {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(19, 27, 37, 0.96);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 3px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(67, 196, 255, 0.78), rgba(123, 115, 255, 0.62)),
    rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 16px;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-brand h1,
.topbar h2,
.panel-head h3,
.section-copy h4,
.module-card h5 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.auth-card,
.guild-selector {
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.empty,
.tiny {
  color: var(--muted);
}

.empty {
  margin: 0;
}

.tiny {
  font-size: 0.9rem;
  line-height: 1.6;
}

.guild-selector label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.user-card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.user-card img,
.avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #08141c;
  font-weight: 800;
}

.user-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin: 22px 0 28px;
}

.sidebar-nav a {
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text);
  background: rgba(67, 196, 255, 0.12);
  transform: translateX(4px);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
}

.ghost-button,
.solid-button,
.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.solid-button,
.refresh-button {
  border: none;
  color: #07121a;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 14px 30px rgba(67, 196, 255, 0.18);
}

.ghost-button:hover,
.solid-button:hover,
.refresh-button:hover {
  transform: translateY(-2px);
}

.full {
  width: 100%;
}

.small {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.main-panel {
  padding: 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notice {
  display: none;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.notice span {
  display: block;
}

.notice.info,
.notice.success,
.notice.error {
  display: block;
}

.notice.info {
  background: rgba(67, 196, 255, 0.1);
}

.notice.success {
  background: rgba(111, 224, 154, 0.11);
}

.notice.error {
  background: rgba(255, 125, 151, 0.12);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card,
.panel,
.module-banner,
.reward-empty,
.check-item {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 18px;
  border-radius: 20px;
}

.summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.summary-card strong {
  font-size: 1.7rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 22px;
  border-radius: 24px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.module-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-banner {
  padding: 18px;
  border-radius: 18px;
}

.badge-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.module-banner strong {
  line-height: 1.6;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.dashboard-lock {
  display: none;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 213, 102, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 213, 102, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(24, 33, 46, 0.96), rgba(14, 22, 33, 0.96));
  box-shadow: var(--shadow);
}

.settings-form.is-locked .dashboard-lock {
  display: grid;
}

.settings-form.is-locked .panel-section,
.settings-form.is-locked .form-actions {
  display: none;
}

.dashboard-lock h4 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.45rem;
}

.dashboard-lock p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-section {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
}

.section-copy p,
.module-copy,
.checklist-head span,
.reward-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.tight {
  gap: 10px;
}

.form-grid label,
.module-card label,
.reward-role-row label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(8, 14, 22, 0.82);
  color: var(--text);
  outline: none;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(67, 196, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(67, 196, 255, 0.12);
}

.automod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.wide-toggle {
  min-width: 260px;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checklist-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.checklist-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.channel-checklist {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.check-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.reward-role-list {
  display: grid;
  gap: 12px;
}

.reward-empty {
  padding: 18px;
  border-radius: 18px;
}

.reward-empty strong {
  font-family: "Sora", sans-serif;
}

.reward-role-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.reward-role-select-wrap {
  min-width: 0;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(35, 47, 64, 0.9), rgba(19, 27, 38, 0.96));
}

.module-card header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.read-only-card {
  align-content: start;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

thead th {
  color: var(--muted);
  font-size: 0.92rem;
}

.feed {
  display: grid;
  gap: 12px;
}

.feed-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.feed-item strong {
  display: block;
  margin-bottom: 6px;
}

.feed-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.good {
  background: rgba(111, 224, 154, 0.14);
  color: #98ffc0;
}

.badge.warn {
  background: rgba(255, 213, 102, 0.14);
  color: #ffe39a;
}

.badge.danger {
  background: rgba(255, 125, 151, 0.16);
  color: #ffb5c4;
}

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

  .module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .dashboard-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .module-banner-grid,
  .automod-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .form-grid.two,
  .form-grid.three,
  .form-grid.four {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .main-panel {
    padding: 22px 18px 28px;
  }

  .topbar,
  .inline-row,
  .topbar-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-grid,
  .form-grid.two,
  .form-grid.three,
  .form-grid.four,
  .reward-role-row {
    grid-template-columns: 1fr;
  }
}
