:root {
  --bg: #09111f;
  --panel: rgba(13, 20, 37, 0.82);
  --panel-soft: rgba(20, 28, 49, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f6f7fb;
  --muted: #aab3ca;
  --accent: #ffb34d;
  --accent-strong: #ff7b1f;
  --accent-cool: #59d4ff;
  --danger: #ff8f8f;
  --success: #8dffc9;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 123, 31, 0.18), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(89, 212, 255, 0.14), transparent 24%),
    linear-gradient(145deg, #06101d 0%, #09111f 44%, #0b1730 100%);
  color: var(--text);
}

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

.ambient,
.grid-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-a {
  background: radial-gradient(circle at 20% 28%, rgba(255, 123, 31, 0.16), transparent 26%);
  filter: blur(34px);
}

.ambient-b {
  background: radial-gradient(circle at 84% 8%, rgba(89, 212, 255, 0.18), transparent 24%);
  filter: blur(38px);
}

.grid-lines {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 88%);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
}

.brand-block h1,
.hero-view h2,
.selection-head h2,
.sidebar-head h2,
.content-head h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-cool);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  font-family: "Space Grotesk", sans-serif;
}

.identity-strip,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity-bar,
.identity-ghost {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.identity-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 179, 77, 0.18), rgba(89, 212, 255, 0.18));
  display: grid;
  place-items: center;
  font-weight: 700;
}

.identity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-copy {
  display: grid;
  gap: 2px;
}

.identity-copy span,
.identity-ghost span,
.hero-text,
.guild-card-members,
.module-item-meta,
.inline-note,
.message {
  color: var(--muted);
}

.view-shell {
  margin-top: 20px;
}

.hero-view,
.selection-head,
.guild-grid,
.dashboard-sidebar,
.content-panel,
.centered-panel {
  padding: 24px;
}

.hero-view {
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
  min-height: 320px;
  align-content: center;
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-text {
  margin: 0;
  max-width: 58ch;
  line-height: 1.9;
}

.selection-view {
  display: grid;
  gap: 18px;
}

.selection-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.selection-badge {
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 179, 77, 0.12);
  color: var(--accent);
  border: 1px solid rgba(255, 179, 77, 0.18);
  white-space: nowrap;
}

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

.guild-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
  transition: 160ms ease;
}

.guild-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 179, 77, 0.34);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.guild-card-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 179, 77, 0.22), rgba(89, 212, 255, 0.18));
  background-size: cover;
  background-position: center;
}

.dashboard-view {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.dashboard-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
  position: sticky;
  top: 24px;
  height: fit-content;
}

.module-list {
  display: grid;
  gap: 10px;
}

.module-item {
  width: 100%;
  text-align: right;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: 160ms ease;
}

.module-item:hover,
.module-item.active {
  transform: translateY(-2px);
  border-color: rgba(255, 179, 77, 0.34);
  background: linear-gradient(145deg, rgba(255, 179, 77, 0.12), rgba(89, 212, 255, 0.08));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.overview-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-top: 18px;
}

.chart-card,
.server-info-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.chart-head {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.chart-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-chart {
  display: flex;
  align-items: end;
  justify-content: space-around;
  min-height: 230px;
  gap: 14px;
}

.chart-bar-wrap {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.chart-value,
.chart-label {
  font-size: 0.9rem;
}

.chart-bar {
  width: 56px;
  border-radius: 18px 18px 8px 8px;
  min-height: 16px;
}

.chart-bar-members {
  background: linear-gradient(180deg, #59d4ff, #2e7df6);
}

.chart-bar-joins {
  background: linear-gradient(180deg, #8dffc9, #1eb980);
}

.chart-bar-leaves {
  background: linear-gradient(180deg, #ffb34d, #ff7b1f);
}

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

.info-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.info-item strong {
  display: block;
  word-break: break-word;
}

.info-item-wide {
  grid-column: 1 / -1;
}

.stat-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.9rem;
  font-family: "Space Grotesk", sans-serif;
}

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

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

.reply-entries {
  display: grid;
  gap: 14px;
}

.reply-entry,
.empty-inline-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.reply-entry {
  display: grid;
  gap: 12px;
}

.reply-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reply-collapse-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: right;
}

.reply-collapse-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
}

.reply-entry-body {
  display: grid;
  gap: 12px;
}

.reply-entry-body[hidden] {
  display: none;
}

.reply-entry.collapsed {
  gap: 0;
}

.reply-responses-builder {
  display: grid;
  gap: 10px;
}

.reply-response-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.response-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(89, 212, 255, 0.16);
  background: rgba(89, 212, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.response-chip-delete {
  color: var(--accent-cool);
  font-weight: 700;
}

.compact-empty {
  padding: 10px 12px;
  border-radius: 16px;
}

.select-control,
.text-input,
.textarea-control {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.select-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    var(--panel-soft);
  color: #f8fbff;
}

.select-control option {
  background: #111827;
  color: #f8fbff;
}

.select-control:focus,
.text-input:focus,
.textarea-control:focus {
  outline: none;
  border-color: rgba(89, 212, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(89, 212, 255, 0.12);
}

.textarea-control {
  min-height: 150px;
  resize: vertical;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 18px;
  padding: 12px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #2b1600;
  font-weight: 700;
}

.secondary-button,
.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.danger-button {
  color: #ffd8d8;
  background: rgba(255, 143, 143, 0.08);
  border: 1px solid rgba(255, 143, 143, 0.16);
}

.large-button {
  padding: 14px 22px;
}

.centered-panel {
  text-align: center;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
  }

  .guild-grid,
  .stats-grid,
  .overview-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1240px);
  }

  .selection-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .guild-grid,
  .stats-grid,
  .overview-layout,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .identity-strip,
  .topbar-actions {
    flex-wrap: wrap;
  }

  .mini-chart {
    min-height: 180px;
  }
}
