:root {
  --primary: #4fc3f7;
  --primary-dark: #29b6f6;
  --accent: #0288d1;
  --bg: #f0f9ff;
  --card: #ffffff;
  --text: #0d1b2a;
  --muted: #546e7a;
  --border: #b3e5fc;
  --success: #2e7d32;
  --danger: #c62828;
  --warning: #ef6c00;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(79, 195, 247, 0.12);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1140px; margin: 0 auto; padding: 0 20px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.3rem; color: var(--accent); }
.logo span { font-size: 1.4rem; }
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a { font-weight: 500; color: var(--muted); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: .95rem;
  border: none; cursor: pointer; transition: all .2s; font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: 0 4px 14px rgba(2,136,209,.3); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--accent); }
.btn-outline:hover { background: #e1f5fe; }
.btn-danger { background: #ff5252; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-discord { background: #5865F2; color: #fff; }
.btn-discord:hover { background: #4752c4; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Hero */
.hero { text-align: center; padding: 80px 20px 60px; position: relative; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 16px; }
.hero h1 span { background: linear-gradient(135deg, var(--primary-dark), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin: 0 auto 28px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.stats { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.stat-n { display: block; font-size: 1.7rem; font-weight: 800; color: var(--accent); }
.stat-l { font-size: .9rem; color: var(--muted); }

/* Cards & Grid */
.section { padding: 60px 20px; }
.section-title { text-align: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }

/* CTA */
.cta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px; padding: 40px; text-align: center; color: #fff; margin: 40px auto; max-width: 700px;
}
.cta h2 { margin-bottom: 10px; }
.cta p { opacity: .9; margin-bottom: 20px; }
.cta .btn-primary { background: #fff; color: var(--accent); }

/* Footer */
.footer { background: #fff; border-top: 1px solid var(--border); padding: 30px 20px; text-align: center; color: var(--muted); font-size: .9rem; }

/* Auth */
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 40px; width: 100%; max-width: 400px; text-align: center; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-card .sub { color: var(--muted); margin-bottom: 28px; }

/* Dashboard Layout */
.dash { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 240px; background: #fff; border-right: 1px solid var(--border);
  padding: 20px 12px; flex-shrink: 0;
}
.sidebar h4 { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 10px; margin: 16px 0 8px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .92rem; margin-bottom: 2px;
}
.side-link:hover, .side-link.active { background: #e1f5fe; color: var(--accent); }
.main { flex: 1; padding: 28px; overflow-y: auto; }
.main h1 { font-size: 1.5rem; margin-bottom: 4px; }
.main .subtitle { color: var(--muted); margin-bottom: 24px; }

/* Guild list */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guild-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s;
}
.guild-card:hover { transform: translateY(-2px); }
.guild-card .top { display: flex; align-items: center; gap: 12px; }
.guild-icon {
  width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1.2rem;
  overflow: hidden; flex-shrink: 0;
}
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-name { font-weight: 700; font-size: 1.05rem; }
.guild-meta { font-size: .85rem; color: var(--muted); }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: .75rem; font-weight: 600;
}
.badge-ok { background: #e8f5e9; color: var(--success); }
.badge-off { background: #ffebee; color: var(--danger); }
.badge-warn { background: #fff3e0; color: var(--warning); }
.badge-info { background: #e1f5fe; color: var(--accent); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,195,247,.2);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #f5fafd; border-radius: 8px; margin-bottom: 8px;
}
.toggle-switch {
  width: 44px; height: 24px; background: #ccc; border-radius: 12px; position: relative; cursor: pointer; transition: .2s;
}
.toggle-switch.on { background: var(--accent); }
.toggle-switch::after {
  content: ''; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%;
  top: 3px; left: 3px; transition: .2s;
}
.toggle-switch.on::after { left: 23px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: .92rem; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--border); flex-wrap: wrap; }
.tab {
  padding: 10px 18px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; font-size: .95rem;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: #0d1b2a; color: #fff;
  padding: 14px 22px; border-radius: 10px; font-weight: 500; z-index: 999;
  transform: translateY(100px); opacity: 0; transition: all .3s;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Loading */
.loading { text-align: center; padding: 60px; color: var(--muted); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .dash { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
