*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0a0a0b;
  color: #e0e0e0;
  min-height: 100vh;
  line-height: 1.5;
}

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

.nav {
  background: #111113;
  border-bottom: 1px solid #1e1e21;
  padding: 0 24px;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.nav-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand-icon svg {
  width: 18px;
  height: 18px;
  color: #0a0a0b;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: #888;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.btn-primary {
  background: #fff;
  color: #0a0a0b;
}

.btn-primary:hover {
  background: #e0e0e0;
}

.btn-secondary {
  background: #1a1a1d;
  color: #d0d0d0;
  border: 1px solid #2a2a2e;
}

.btn-secondary:hover {
  background: #242428;
}

.btn-danger {
  background: transparent;
  color: #e05050;
  border: 1px solid #3a1a1a;
}

.btn-danger:hover {
  background: #1a1010;
}

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 32px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: #f0f0f0;
}

.page-header p {
  color: #777;
  font-size: 14px;
  margin-top: 4px;
}

.card {
  background: #111113;
  border: 1px solid #1e1e21;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: #2a2a2e;
}

.card-header {
  font-size: 16px;
  font-weight: 500;
  color: #e0e0e0;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.guild-card {
  background: #111113;
  border: 1px solid #1e1e21;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
  cursor: pointer;
}

.guild-card:hover {
  border-color: #3a3a3e;
}

.guild-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.guild-icon-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e1e21;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  color: #888;
  flex-shrink: 0;
}

.guild-name {
  font-size: 15px;
  font-weight: 500;
  color: #e0e0e0;
  letter-spacing: -0.2px;
}

.sidebar-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.sidebar {
  background: #111113;
  border: 1px solid #1e1e21;
  border-radius: 8px;
  padding: 12px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: #888;
  transition: all 0.15s;
}

.sidebar a:hover {
  background: #1a1a1d;
  color: #d0d0d0;
}

.sidebar a.active {
  background: #1a1a1d;
  color: #f0f0f0;
}

.sidebar a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  background: #0a0a0b;
  border: 1px solid #2a2a2e;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.input:focus {
  outline: none;
  border-color: #555;
}

.input::placeholder {
  color: #444;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

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

.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1e1e21;
}

.table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid #141417;
  color: #c0c0c0;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #555;
  font-size: 14px;
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: #333;
  margin-bottom: 12px;
}

.flash {
  background: #111113;
  border: 1px solid #2a2a2e;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #a0a0a0;
  animation: fadeIn 0.3s ease;
}

.home-hero {
  text-align: center;
  padding: 80px 24px;
}

.home-hero h1 {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -1px;
  color: #f0f0f0;
  margin-bottom: 12px;
}

.home-hero p {
  color: #666;
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 32px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.feature-card {
  background: #111113;
  border: 1px solid #1e1e21;
  border-radius: 8px;
  padding: 24px;
  text-align: left;
}

.feature-card svg {
  width: 24px;
  height: 24px;
  color: #888;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 500;
  color: #e0e0e0;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-box {
  background: #111113;
  border: 1px solid #1e1e21;
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-box svg {
  width: 40px;
  height: 40px;
  color: #888;
  margin-bottom: 16px;
}

.login-box h1 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-box p {
  color: #666;
  font-size: 14px;
  margin-bottom: 28px;
}

@media (max-width: 768px) {
  .sidebar-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 8px;
  }

  .sidebar a {
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 12px;
  }

  .nav {
    padding: 0 16px;
  }

  .main {
    padding: 24px 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .home-hero h1 {
    font-size: 28px;
  }
}

.guild-section {
  margin-bottom: 32px;
}

.guild-section-title {
  font-size: 13px;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.invite-card {
  opacity: 0.7;
}

.invite-card:hover {
  opacity: 1;
}

.guild-invite-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #777;
  flex-shrink: 0;
}

.guild-invite-badge svg {
  width: 12px;
  height: 12px;
}