/* ═══════════════════════════════════════════════════════
   NexCore Dashboard — Modern UI
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:          #070b14;
  --bg2:         #0b0f1c;
  --sidebar:     #080c18;
  --card:        #0e1525;
  --card2:       #111929;
  --border:      rgba(255,255,255,0.06);
  --border2:     rgba(255,255,255,0.10);

  --accent:      #5865F2;
  --accent-2:    #7983f5;
  --accent-glow: rgba(88,101,242,0.35);
  --accent-soft: rgba(88,101,242,0.12);

  --success:     #23d18b;
  --success-soft:rgba(35,209,139,0.12);
  --danger:      #f14668;
  --danger-soft: rgba(241,70,104,0.12);
  --warning:     #ffdd57;

  --text:        #e8eeff;
  --text-2:      #a0aec0;
  --text-3:      #576175;

  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.6);
  --transition:  0.18s cubic-bezier(0.4,0,0.2,1);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════ */

.layout { display: flex; min-height: 100vh; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */

.sidebar {
  width: 250px;
  min-height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background-image: linear-gradient(180deg, rgba(88,101,242,0.04) 0%, transparent 40%);
}

/* Server header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
}

.server-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.server-icon-placeholder {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7983f5);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.server-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.2px;
  color: var(--text);
}
.server-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Nav */
.sidebar-nav { padding: 12px 10px; flex: 1; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 15px; width: 18px; text-align: center; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 10px;
}

/* User section */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border2);
  flex-shrink: 0;
}

.user-info { min-width: 0; flex: 1; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.logout-link {
  font-size: 11px;
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--transition);
}
.logout-link:hover { color: var(--danger); }

/* Bot status */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

.bot-status {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bot-status.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.bot-status.offline { background: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */

.main { flex: 1; overflow-x: hidden; }
.main-inner { max-width: 1120px; padding: 36px 32px; }

/* Page header */
.page-header { margin-bottom: 32px; }
.page-title  { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.page-sub    { color: var(--text-2); margin-top: 5px; font-size: 14px; }

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border2); }

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.card-body { padding: 22px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

/* ══════════════════════════════════════════════════════════════
   STATS
   ══════════════════════════════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  transition: all var(--transition);
  cursor: default;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.stat-icon  { font-size: 30px; margin-bottom: 10px; display: block; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat-unit  { font-size: 14px; font-weight: 400; color: var(--text-2); }
.stat-label { color: var(--text-3); font-size: 12px; margin-top: 5px; font-weight: 500; letter-spacing: 0.3px; }

.stat-row      { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-label-sm { font-size: 13px; color: var(--text-2); }
.stat-value-lg { font-size: 28px; font-weight: 800; }
.accent { color: var(--accent-2); }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */

.form-group  { margin-bottom: 20px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label  { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-hint   { font-size: 12px; color: var(--text-3); margin-bottom: 7px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  transition: all var(--transition);
  outline: none;
}

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

.form-input::placeholder { color: var(--text-3); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select option { background: var(--card); color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7983f5);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: rgba(255,255,255,0.10); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(241,70,104,0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-discord {
  background: linear-gradient(135deg, #5865F2, #7983f5);
  color: #fff;
  justify-content: center;
  gap: 12px;
  padding: 13px 24px;
  font-size: 15px;
  box-shadow: 0 4px 20px rgba(88,101,242,0.4);
}
.btn-discord:hover {
  box-shadow: 0 6px 28px rgba(88,101,242,0.6);
  transform: translateY(-1px);
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: 6px 12px; font-size: 12px; }

/* ══════════════════════════════════════════════════════════════
   SAVE STATUS
   ══════════════════════════════════════════════════════════════ */

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 14px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}
.save-status.show { opacity: 1; }
.save-status.ok  { color: var(--success); }
.save-status.err { color: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════════════════════ */

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
  color: var(--text-3);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text);
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover td { background: rgba(255,255,255,0.03); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  font-size: 12px;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-neutral { background: rgba(255,255,255,0.07); color: var(--text-2); }

/* ══════════════════════════════════════════════════════════════
   FAQ
   ══════════════════════════════════════════════════════════════ */

.faq-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}
.faq-entry:hover { border-color: var(--border2); }
.faq-question { font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.faq-answer   { color: var(--text-2); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.faq-actions  { display: flex; gap: 8px; }

/* ══════════════════════════════════════════════════════════════
   ALERTS & INFO
   ══════════════════════════════════════════════════════════════ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
}
.alert-error {
  background: var(--danger-soft);
  border: 1px solid rgba(241,70,104,0.25);
  color: #ff8090;
}

.info-banner {
  background: var(--accent-soft);
  border: 1px solid rgba(88,101,242,0.25);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 13.5px;
  color: #a5b4fc;
  margin-bottom: 20px;
}

.empty-state {
  color: var(--text-3);
  text-align: center;
  padding: 36px 20px;
  font-size: 14px;
  line-height: 1.8;
}

/* ══════════════════════════════════════════════════════════════
   ACCESS / ROLES
   ══════════════════════════════════════════════════════════════ */

.role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.role-row:last-child { border-bottom: none; }
.role-name { font-size: 14px; font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   QUICK LINKS (home page)
   ══════════════════════════════════════════════════════════════ */

.quick-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.quick-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-card:hover {
  border-color: var(--accent);
  background: var(--card2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.quick-card-icon { font-size: 28px; }
.quick-card-title { font-size: 15px; font-weight: 700; }
.quick-card-desc  { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.quick-card-arrow { color: var(--text-3); font-size: 18px; margin-top: auto; }

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(88,101,242,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(121,131,245,0.06) 0%, transparent 50%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 44px 40px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  font-size: 52px;
  text-align: center;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 20px rgba(88,101,242,0.5));
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.login-sub {
  color: var(--text-2);
  text-align: center;
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════ */

.text-muted { color: var(--text-2); }
.text-dim   { color: var(--text-3); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 28px; }

code {
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--accent-2);
}

/* ── Page enter animation ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-inner { animation: fadeUp 0.3s ease both; }
