:root {
  --bg: #080912;
  --surface: #121522;
  --surface-2: #191d2e;
  --surface-3: #20263b;
  --line: #303955;
  --text: #f4f7ff;
  --muted: #98a3bd;
  --primary: #6d7dff;
  --primary-2: #8b5cf6;
  --cyan: #3fc8ff;
  --danger: #ff6475;
  --success: #51e6a7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(109, 125, 255, 0.28), transparent 58%),
    radial-gradient(780px 460px at 90% 8%, rgba(63, 200, 255, 0.18), transparent 60%),
    linear-gradient(145deg, #070812, #111424 56%, #080912);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-shell {
  width: min(1280px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

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

.brand,
.top-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 34px rgba(109, 125, 255, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.muted {
  color: var(--muted);
}

.user-chip,
.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #dfe6ff;
  background: rgba(18, 21, 34, 0.78);
}

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: var(--surface-3);
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  border-color: rgba(109, 125, 255, 0.9);
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
}

.button.ghost {
  background: rgba(32, 38, 59, 0.72);
}

.button.tiny {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.button.danger {
  border-color: rgba(255, 100, 117, 0.6);
  background: rgba(255, 100, 117, 0.18);
}

.flash {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(25, 29, 46, 0.92);
}

.flash.success {
  border-color: rgba(81, 230, 167, 0.5);
  color: var(--success);
}

.flash.error {
  border-color: rgba(255, 100, 117, 0.5);
  color: var(--danger);
}

.hero {
  min-height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: center;
  gap: 22px;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 720px;
  color: #c4cce2;
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  margin-top: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-board,
.panel,
.card,
.sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 21, 34, 0.84);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}

.status-board {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.status-board article,
.announcement-preview {
  border: 1px solid rgba(109, 125, 255, 0.3);
  border-radius: 8px;
  padding: 16px;
  background: rgba(32, 38, 59, 0.7);
}

.status-board span,
.announcement-preview span {
  color: var(--muted);
  font-size: 13px;
}

.status-board strong,
.announcement-preview strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
}

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

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 14px;
}

.sidebar-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sidebar-title span {
  font-weight: 900;
}

.sidebar-title small {
  color: var(--muted);
}

.guild-list {
  display: grid;
  gap: 8px;
}

.guild-link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px;
  background: rgba(32, 38, 59, 0.55);
}

.guild-link.active {
  border-color: var(--primary);
  background: rgba(109, 125, 255, 0.14);
}

.guild-link img,
.guild-fallback,
.guild-header img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

.guild-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--surface-3), var(--primary-2));
  font-weight: 900;
}

.guild-link strong,
.guild-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-link small {
  color: var(--muted);
}

.guild-main {
  min-width: 0;
}

.guild-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.guild-header h1,
.panel h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: #dce5ff;
  background: rgba(18, 21, 34, 0.78);
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  border-color: var(--primary);
  background: rgba(109, 125, 255, 0.2);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel {
  padding: 18px;
}

.compact-panel {
  margin-top: 14px;
}

.compact-panel p {
  margin: 0 0 12px;
}

.empty-panel,
.error-panel {
  min-height: 280px;
}

.panel h2,
.card h3 {
  margin: 0 0 14px;
}

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

.form-grid h2,
.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: #dce5ff;
  font-weight: 800;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #0d101d;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.checks {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.checks legend {
  padding: 0 6px;
  color: var(--muted);
}

.checks label,
.switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checks input,
.switch input {
  width: auto;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.card {
  padding: 16px;
}

.card p {
  color: #c6cfe4;
  line-height: 1.5;
}

.card form {
  margin-top: 12px;
}

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

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero,
  .layout,
  .staff-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 18px, 1280px);
  }

  .top-actions,
  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: 40px;
  }
}
