/* --------------------------------------------------------------------
   Nolfcheck — Premium SaaS Dashboard
   A quiet, spacious, glass-and-shadow design system.
   Fonts: Space Grotesk (display) · Inter (body) · JetBrains Mono (code)
------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- Surfaces — near-monochrome, depth comes from shadow, not line ---- */
  --bg-base:        #08080a;
  --bg-surface:     #0e0e11;
  --bg-elevated:    #141418;
  --bg-hover:       #1a1a1f;
  --bg-input:       #0b0b0d;
  --bg-sidebar:     rgba(14, 14, 17, 0.6);
  --bg-glass:       rgba(255, 255, 255, 0.025);
  --bg-glass-strong: rgba(255, 255, 255, 0.045);
  --bg-overlay:     rgba(6, 6, 8, 0.7);

  /* ---- Borders — used sparingly, almost invisible ------------------------ */
  --border:         rgba(255, 255, 255, 0.045);
  --border-strong:  rgba(255, 255, 255, 0.09);
  --border-hover:   rgba(255, 255, 255, 0.14);
  --border-focus:   rgba(130, 113, 255, 0.5);
  --hairline:       rgba(255, 255, 255, 0.06);

  /* ---- Text ---------------------------------------------------------------- */
  --text-primary:   #fafafa;
  --text-secondary: #98979f;
  --text-muted:     #5c5b64;
  --text-label:     #86858e;
  --text-faint:     #38373d;

  /* ---- Accent — one calm, confident hue -------------------------------------- */
  --accent:         #7C6AF0;
  --accent-hover:   #8F7FF5;
  --accent-active:  #6555D8;
  --accent-soft:    rgba(124, 106, 240, 0.10);
  --accent-soft-2:  rgba(124, 106, 240, 0.18);
  --accent-glow:    rgba(124, 106, 240, 0.35);
  --accent-border:  rgba(124, 106, 240, 0.28);
  --accent-text:    #c3b8ff;

  /* ---- Semantic — desaturated, used only where it matters ---------------------- */
  --green:          #4ADE9B;
  --green-soft:     rgba(74, 222, 155, 0.10);
  --green-border:   rgba(74, 222, 155, 0.24);
  --red:            #F2596A;
  --red-soft:       rgba(242, 89, 106, 0.10);
  --red-border:     rgba(242, 89, 106, 0.24);
  --yellow:         #F0B44E;
  --yellow-soft:    rgba(240, 180, 78, 0.10);
  --yellow-border:  rgba(240, 180, 78, 0.24);

  /* ---- Layout ------------------------------------------------------------------- */
  --sidebar-w:      264px;
  --sidebar-gap:    14px;
  --topbar-h:       84px;

  /* ---- Radius — generous, confident curves --------------------------------------- */
  --radius-xs:      10px;
  --radius-sm:      14px;
  --radius-md:      20px;
  --radius-lg:      26px;
  --radius-xl:      32px;
  --radius-2xl:     40px;
  --radius-full:    999px;

  /* ---- Shadows — soft, deep, low-opacity; this is where depth lives -------------- */
  --shadow-xs:      0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm:      0 6px 20px -8px rgba(0, 0, 0, 0.55);
  --shadow-md:      0 20px 48px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg:      0 40px 90px -24px rgba(0, 0, 0, 0.7);
  --shadow-glow:    0 0 0 1px var(--accent-border), 0 24px 64px -12px var(--accent-glow);
  --shadow-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* ---- Motion — unhurried, cinematic easing --------------------------------------- */
  --ease:           cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:       cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:       140ms;
  --dur:            240ms;
  --dur-slow:       420ms;

  /* ---- Type --------------------------------------------------------------------- */
  --font-display:   'Space Grotesk', sans-serif;
  --font-body:      'Inter', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14.5px;
  letter-spacing: -0.008em;
  font-weight: 400;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  color: var(--accent-text);
}
::selection { background: var(--accent-soft-2); color: #fff; }

/* BUTTONS — quiet, confident, Linear/Vercel-grade ------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  cursor: pointer; border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur-fast) var(--ease), color var(--dur) var(--ease), filter var(--dur) var(--ease);
  white-space: nowrap; line-height: 1;
  letter-spacing: -0.005em;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft-2); }
.btn svg { flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-highlight), 0 1px 2px rgba(0,0,0,0.3), 0 8px 20px -6px var(--accent-glow);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-highlight), 0 14px 32px -8px var(--accent-glow); }
.btn-ghost { background: var(--bg-glass-strong); color: var(--text-secondary); backdrop-filter: blur(12px); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateY(-1px); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; box-shadow: 0 10px 24px -6px rgba(242,89,106,0.4); transform: translateY(-1px); }
.btn-success { background: var(--green-soft); color: var(--green); }
.btn-success:hover { background: var(--green); color: #06231a; box-shadow: 0 10px 24px -6px rgba(74,222,155,0.35); transform: translateY(-1px); }
.btn-warning { background: var(--yellow-soft); color: var(--yellow); }
.btn-warning:hover { background: var(--yellow); color: #241705; box-shadow: 0 10px 24px -6px rgba(240,180,78,0.35); transform: translateY(-1px); }
.btn-sm  { padding: 8px 15px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-lg  { padding: 13px 28px; font-size: 14.5px; border-radius: var(--radius-md); }
.btn-xs  { padding: 6px 11px; font-size: 11.5px; border-radius: var(--radius-xs); }

/* LANDING ------------------------------------------------------------------------ */
.landing { min-height: 100vh; background: var(--bg-base); position: relative; }
.landing-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.landing-orb { position: absolute; border-radius: 50%; filter: blur(140px); opacity: 0.28; }
.orb-1 { width: 720px; height: 720px; background: radial-gradient(circle at 32% 32%, #a495ff, #6047e8 72%); top: -260px; right: -200px; animation: orb-float 16s ease-in-out infinite; }
.orb-2 { width: 560px; height: 560px; background: radial-gradient(circle at 40% 40%, #3f2f9e, #1a1442 72%); bottom: -160px; left: -160px; opacity: 0.22; animation: orb-float 20s ease-in-out infinite reverse; }
.orb-3 { width: 420px; height: 420px; background: radial-gradient(circle at 50% 50%, #d8cfff, #7c6af0 72%); top: 36%; left: 40%; opacity: 0.14; animation: orb-float 24s ease-in-out infinite 4s; }
.landing-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, black, transparent);
}
@keyframes orb-float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-44px) scale(1.04); } }

.landing-nav {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 56px; height: 76px;
  background: rgba(8, 8, 10, 0.6);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--hairline);
}
.nav-logo { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.015em; }
.nav-logo-icon { width: 34px; height: 34px; background: linear-gradient(165deg, var(--accent-hover), var(--accent-active)); border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff; box-shadow: var(--shadow-highlight), 0 6px 18px -4px var(--accent-glow); }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a:not(.btn) { color: var(--text-secondary); font-size: 13.5px; font-weight: 500; transition: color var(--dur) var(--ease); }
.nav-links a:not(.btn):hover { color: var(--text-primary); }

.hero { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 140px 24px 96px; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 9px; background: var(--bg-glass-strong); border: 1px solid var(--border); color: var(--text-secondary); padding: 7px 16px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 600; margin-bottom: 36px; backdrop-filter: blur(12px); }
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hero-title { font-family: var(--font-display); font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 600; line-height: 1.06; margin-bottom: 26px; letter-spacing: -0.04em; }
.hero-accent { background: linear-gradient(120deg, var(--accent-hover) 0%, #d8cfff 45%, var(--accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 17px; color: var(--text-secondary); max-width: 560px; margin: 0 auto 46px; line-height: 1.7; font-weight: 400; }
.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero-error { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; background: var(--red-soft); border: 1px solid var(--red-border); color: #ffb4bd; padding: 11px 18px; border-radius: var(--radius-md); font-size: 13px; }

.features { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 40px 24px 100px; }
.features-header { text-align: center; margin-bottom: 56px; }
.features-header h2 { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; margin-bottom: 12px; letter-spacing: -0.03em; }
.features-header p { color: var(--text-secondary); font-size: 15px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.feature-card { background: var(--bg-glass); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 28px; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.feature-card:hover { border-color: var(--border-hover); background: var(--bg-glass-strong); transform: translateY(-6px); box-shadow: var(--shadow-md); }
.feature-icon { width: 46px; height: 46px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; background: var(--accent-soft); color: var(--accent-text); }
.feature-icon svg { width: 19px; height: 19px; }
.feature-card h3 { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; margin-bottom: 9px; letter-spacing: -0.012em; }
.feature-card p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.7; }

.cta { position: relative; z-index: 1; padding: 0 24px 110px; }
.cta-card { max-width: 640px; margin: 0 auto; background: linear-gradient(175deg, var(--bg-glass-strong), var(--bg-surface)); backdrop-filter: blur(24px); border: 1px solid var(--border-strong); border-radius: var(--radius-2xl); padding: 72px 48px; text-align: center; box-shadow: var(--shadow-lg), 0 0 120px rgba(124,106,240,0.10); }
.cta-card h2 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.03em; }
.cta-card p { color: var(--text-secondary); margin-bottom: 34px; font-size: 15px; }
.footer { position: relative; z-index: 1; text-align: center; padding: 36px; color: var(--text-faint); font-size: 12px; border-top: 1px solid var(--hairline); }
.footer a { color: var(--accent-text); }
.footer a:hover { text-decoration: underline; }

/* LEGAL PAGES (Privacy & Terms) --------------------------------------------------- */
.legal-section { position: relative; z-index: 1; max-width: 840px; margin: 0 auto; padding: 80px 24px 40px; }
.legal-container { background: var(--bg-glass); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 60px; box-shadow: var(--shadow-md); }
.legal-container h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.03em; }
.legal-container .legal-date { color: var(--text-muted); font-size: 13px; margin-bottom: 44px; }
.legal-container h2 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 34px 0 14px; color: var(--text-primary); letter-spacing: -0.015em; }
.legal-container p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 14px; }
.legal-container ul { margin: 0 0 18px 20px; color: var(--text-secondary); line-height: 1.8; }
.legal-container li { margin-bottom: 7px; }

/* HOME ------------------------------------------------------------------------------ */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; height: var(--topbar-h); background: rgba(8,8,10,0.65); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border-bottom: 1px solid var(--hairline); }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.015em; }
.topbar-logo-icon { width: 30px; height: 30px; background: linear-gradient(165deg, var(--accent-hover), var(--accent-active)); border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; box-shadow: var(--shadow-highlight); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-secondary); }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 3px var(--border-strong); }
.home-main { max-width: 1200px; margin: 0 auto; padding: 52px 32px; width: 100%; }
.home-header { margin-bottom: 40px; }
.home-header h1 { font-family: var(--font-display); font-size: 1.85rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.03em; }
.home-header p { color: var(--text-secondary); font-size: 13.5px; }

.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.guild-card { background: var(--bg-glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); display: flex; flex-direction: column; }
.guild-card:hover { border-color: var(--border-hover); transform: translateY(-5px); box-shadow: var(--shadow-md); }
.guild-card-header { position: relative; height: 122px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.guild-card-banner { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 500ms var(--ease); }
.guild-card:hover .guild-card-banner { transform: scale(1.06); }
.guild-card-banner.fallback-blur { filter: blur(24px) brightness(0.3); transform: scale(1.25); }
.guild-card:hover .guild-card-banner.fallback-blur { transform: scale(1.3); }
.guild-card-banner.default-gradient { background: linear-gradient(150deg, #17171c, #0a0a0c); }
.guild-card-icon-wrap { position: relative; z-index: 2; }
.guild-card-icon, .guild-card-icon-placeholder { width: 68px; height: 68px; border-radius: 50%; border: 3px solid var(--bg-surface); box-shadow: 0 10px 28px rgba(0,0,0,0.6); object-fit: cover; }
.guild-card-icon-placeholder { background: linear-gradient(165deg, var(--accent-hover), var(--accent-active)); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: #fff; }
.guild-card-body { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--bg-glass); }
.guild-card-info { flex: 1; min-width: 0; }
.guild-card-name { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; color: var(--text-primary); letter-spacing: -0.012em; }
.guild-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; }
.badge-gold  { background: var(--yellow-soft); color: var(--yellow); }
.badge-blue  { background: var(--accent-soft); color: var(--accent-text); }
.badge-green { background: var(--green-soft); color: var(--green); }
.guild-card-actions { flex-shrink: 0; }
.empty-state { text-align: center; padding: 110px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 18px; opacity: 0.6; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 9px; }
.empty-state p { font-size: 13.5px; margin-bottom: 26px; line-height: 1.7; }

/* DASHBOARD LAYOUT -------------------------------------------------------------------- */
.dashboard-layout { display: flex; min-height: 100vh; background: var(--bg-base); }

.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  margin: var(--sidebar-gap) 0 var(--sidebar-gap) var(--sidebar-gap);
  height: calc(100vh - (var(--sidebar-gap) * 2));
  background: var(--bg-sidebar);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--shadow-highlight);
  display: flex; flex-direction: column;
  position: sticky; top: var(--sidebar-gap);
  overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-header { padding: 22px 18px 18px; }
.sidebar-logo { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.015em; }
.sidebar-logo-icon { width: 32px; height: 32px; background: linear-gradient(165deg, var(--accent-hover), var(--accent-active)); border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; box-shadow: var(--shadow-highlight), 0 6px 18px -4px var(--accent-glow); }
.sidebar-guild { display: flex; align-items: center; gap: 11px; margin: 0 10px 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg-glass); cursor: pointer; transition: background var(--dur) var(--ease); }
.sidebar-guild:hover { background: var(--bg-glass-strong); }
.sidebar-guild-icon, .sidebar-guild-icon-placeholder { width: 36px; height: 36px; border-radius: var(--radius-xs); object-fit: cover; flex-shrink: 0; }
.sidebar-guild-icon-placeholder { background: linear-gradient(165deg, var(--accent-hover), var(--accent-active)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 12px; }
.sidebar-guild-info { flex: 1; overflow: hidden; }
.sidebar-guild-name { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.sidebar-guild-id { font-size: 10.5px; color: var(--text-muted); }
.sidebar-nav { flex: 1; padding: 6px 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); padding: 20px 12px 8px; }
.sidebar-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: var(--radius-xs);
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.sidebar-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.6; color: var(--text-secondary); transition: opacity var(--dur), color var(--dur); }
.sidebar-nav-item:hover { background: var(--bg-glass-strong); color: var(--text-primary); }
.sidebar-nav-item:hover svg { opacity: 1; }
.sidebar-nav-item.active { background: linear-gradient(135deg, var(--accent-soft-2), var(--accent-soft)); color: #fff; font-weight: 600; box-shadow: var(--shadow-highlight); }
.sidebar-nav-item.active::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: var(--radius-full); background: var(--accent-hover); box-shadow: 0 0 12px var(--accent-glow); }
.sidebar-nav-item.active svg { opacity: 1; color: var(--accent-text); }
.sidebar-nav-divider { height: 1px; background: var(--hairline); margin: 10px 12px; }
.sidebar-user { margin: 8px 10px 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg-glass); display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { width: 28px; height: 28px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: background var(--dur), color var(--dur); flex-shrink: 0; }
.sidebar-logout svg { width: 13px; height: 13px; }
.sidebar-logout:hover { background: var(--red-soft); color: var(--red); }

.dashboard-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.dashboard-topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 8px 40px; min-height: var(--topbar-h); background: rgba(8,8,10,0.5); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border-bottom: 1px solid var(--hairline); }
.page-title h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin-top: 2px; letter-spacing: -0.02em; }
.page-title p { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.dashboard-content { padding: 36px 40px 56px; flex: 1; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 40px; }
.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 24px; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-highlight);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.stat-card:hover { border-color: var(--border-hover); background: var(--bg-glass-strong); transform: translateY(-4px); box-shadow: var(--shadow-md), var(--shadow-highlight); }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-text); }
.stat-icon svg { width: 19px; height: 19px; }
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1; letter-spacing: -0.025em; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-header h3 { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.section-subtitle { font-size: 12px; color: var(--text-muted); }

.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.module-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-glass); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px 20px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.module-card:hover { border-color: var(--border-hover); background: var(--bg-glass-strong); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.module-card-icon { width: 42px; height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-text); }
.module-card-icon svg { width: 18px; height: 18px; }
.module-card-content { flex: 1; min-width: 0; }
.module-card-content h4 { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.008em; }
.module-card-content p { font-size: 12px; color: var(--text-muted); }
.module-card-status { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-full); flex-shrink: 0; }
.status-on  { background: var(--green-soft); color: var(--green); }
.status-off { background: var(--bg-glass-strong); color: var(--text-muted); }

/* FORMS --------------------------------------------------------------------------------- */
.settings-form { max-width: none; width: 100%; display: flex; flex-direction: column; gap: 0; padding-bottom: 150px; margin: 0; }

.settings-card { background: var(--bg-glass); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: visible; box-shadow: var(--shadow-highlight); width: 100%; margin: 0; }
.settings-card + .settings-card { margin-top: 16px; }
.settings-card-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; gap: 12px; border-bottom: 1px solid var(--hairline); }
.settings-card-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.012em; }
.settings-card-body { padding: 24px; }
.settings-card-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 0; line-height: 1.6; }

.section-card-body { display: grid; gap: 12px; padding: 10px 18px; }
.section-card-actions { display: flex; align-items: center; gap: 10px; }

.fixed-save-panel { position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 1000; display: flex; justify-content: center; padding: 14px 22px; background: rgba(20,20,24,0.75); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg), var(--shadow-highlight); border: 1px solid var(--border-strong); }
.fixed-save-panel .form-actions { padding: 0; }
.collapse-btn { border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: transparent; color: var(--text-muted); padding: 8px 15px; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); font-size: 12px; }
.collapse-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.collapse-btn::after { content: '?'; display: inline-block; margin-left: 6px; transition: transform var(--dur) var(--ease); }
.section-card.collapsed .collapse-btn::after { transform: rotate(-90deg); }

.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--bg-glass-strong); border: 1px solid var(--border-strong); border-radius: var(--radius-full); cursor: pointer; transition: background 240ms var(--ease), border-color 240ms var(--ease); }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 50%; transform: translateY(-50%); background: var(--text-muted); border-radius: 50%; transition: transform 240ms var(--ease), background 240ms var(--ease); }
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateY(-50%) translateX(18px); background: #fff; }
.toggle input:focus-visible + .toggle-slider { box-shadow: 0 0 0 4px var(--accent-soft-2); }

.form-select, .form-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 11px 15px; color: var(--text-primary); font-family: var(--font-body); font-size: 13.5px;
  height: 44px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  appearance: none; -webkit-appearance: none;
}
.form-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 12px 15px; color: var(--text-primary); font-family: var(--font-body); font-size: 13.5px;
  resize: vertical; min-height: 96px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.form-select:hover, .form-input:hover, .form-textarea:hover { border-color: var(--border-hover); }
.form-select:focus, .form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); background: var(--bg-elevated); }
.role-search { margin-top: 8px; }
.role-checkbox-grid { display: grid; gap: 8px; margin-top: 12px; max-height: 270px; overflow-y: auto; padding: 12px; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.role-checkbox { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg-glass); border: 1px solid transparent; cursor: pointer; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.role-checkbox:hover { background: var(--bg-glass-strong); border-color: var(--border); }
.role-checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.role-checkbox span { display: inline-block; line-height: 1.4; }
.role-checkbox input:checked + span { font-weight: 700; color: var(--text-primary); }
.role-empty { color: var(--text-muted); font-size: 13px; padding: 14px; }
.input-error { border-color: var(--red) !important; box-shadow: 0 0 0 4px var(--red-soft) !important; }
.error-text { font-size: 12px; color: var(--red); margin-top: 7px; }
.form-select option { background: var(--bg-elevated); }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-label); margin-bottom: 8px; letter-spacing: -0.008em; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }
.radio-grid { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.radio-card { background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.radio-card:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.radio-card input { margin-right: 8px; accent-color: var(--accent); }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.embed-fields-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
}
.embed-fields-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.embed-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.field-row { display: grid; grid-template-columns: 1.6fr 2.4fr auto; gap: 10px; align-items: end; }
.field-row .form-group { margin: 0; }
.inline-switch { display: flex; flex-direction: column; gap: 6px; }
.field-row input { width: 100%; }
.hidden { display: none !important; }
.embed-note { font-size: 12px; color: var(--text-muted); margin-top: 9px; }
.form-help { font-size: 12px; color: var(--text-muted); }
.form-help code { background: var(--bg-elevated); padding: 2px 7px; border-radius: var(--radius-xs); }


.toast { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md); backdrop-filter: blur(12px); animation: toast-in 0.36s var(--ease); }
.toast-success { background: var(--green-soft); border: 1px solid var(--green-border); color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.coming-soon-card { background: var(--bg-glass); backdrop-filter: blur(16px); border: 1px dashed var(--border-strong); border-radius: var(--radius-xl); padding: 72px 36px; text-align: center; max-width: 500px; }
.coming-soon-icon { font-size: 3rem; margin-bottom: 20px; opacity: 0.6; }
.coming-soon-card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.012em; }
.coming-soon-card p { color: var(--text-muted); font-size: 13.5px; line-height: 1.7; }

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-card { text-align: center; max-width: 420px; }
.error-code { font-family: var(--font-display); font-size: 7.5rem; font-weight: 600; line-height: 1; color: var(--bg-elevated); margin-bottom: 16px; text-shadow: 0 0 110px var(--accent-glow); letter-spacing: -0.05em; }
.error-title { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 30px; }
.error-actions { display: flex; justify-content: center; gap: 10px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-glass-strong); border-radius: var(--radius-full); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); background-clip: padding-box; }

@media (max-width: 900px) { .sidebar { display: none; } .dashboard-content { padding: 20px; } .stats-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .guild-grid { grid-template-columns: 1fr; } .stats-row { grid-template-columns: 1fr; } .modules-grid { grid-template-columns: 1fr; } .landing-nav { padding: 0 20px; } .hero { padding: 80px 20px 48px; } .settings-form { max-width: 100%; } .form-grid { grid-template-columns: 1fr; } .embed-grid { grid-template-columns: 1fr; } }



/* -- Ticket-System additions ----------------------------------------------------------- */
/* Add these styles to your existing main.css */

/* Category cards */
.category-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.category-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }

.category-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  user-select: none;
}
.category-card-title {
  display: flex;
  align-items: center;
  gap: 11px;
}
.category-card-emote { font-size: 1.2rem; line-height: 1; }
.category-card-name {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.008em;
}
.category-collapse-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.category-collapse-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.category-card-body {
  padding: 20px;
  display: grid;
  gap: 14px;
}
.category-card-body.hidden { display: none; }

/* Section card body spacing */
.section-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-card-body.hidden { display: none; }

/* Back link in topbar */
.page-title .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color var(--dur) var(--ease);
}
.page-title .back-link:hover { color: var(--accent-text); }

.embed-editor {
  position: relative;
  display: grid;
  gap: 18px;
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.embed-editor .form-input,
.embed-editor .form-textarea,
.embed-editor .form-select {
  background: var(--bg-input);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.embed-editor .form-input:focus,
.embed-editor .form-textarea:focus,
.embed-editor .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
}

.embed-editor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 0;
}

.embed-editor-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

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

.form-group-color {
  max-width: 180px;
}

.form-input-color {
  max-width: 130px;
  padding: 6px;
  height: 44px;
}
