/* ============================================================
   Scyle Shield — Dashboard (redesign)
   A clean, modern dark control panel. One accent, restrained
   glow, generous spacing, monospace only for data/IDs.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0e17;
  --bg-grad: radial-gradient(1200px 600px at 15% -10%, #131b2e 0%, transparent 55%),
             radial-gradient(1000px 500px at 100% 0%, #171226 0%, transparent 50%), #0a0e17;
  --panel: #121826;
  --panel-2: #171f30;
  --elevated: #1d2739;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --accent: #5b8cff;
  --accent-2: #a855f7;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.13);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.13);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.13);

  --text: #e7ecf3;
  --muted: #8b97ab;
  --faint: #5a6577;

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

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --sidebar-w: 244px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--panel) 0%, rgba(18, 24, 38, 0.92) 100%);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
}

.sb-server {
  display: flex; align-items: center; gap: 11px;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  margin-bottom: 6px;
}
.sb-server .icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: var(--elevated); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: var(--accent);
  overflow: hidden;
}
.sb-server .icon img { width: 100%; height: 100%; object-fit: cover; }
.sb-server .meta { overflow: hidden; }
.sb-server .meta .name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-server .meta .sub { font-size: 11px; color: var(--faint); }

.sb-switch {
  width: 100%; margin-bottom: 16px; padding: 8px 10px;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--muted); font-size: 12px;
  cursor: pointer; transition: 0.15s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sb-switch:hover { border-color: var(--accent); color: var(--accent); }

.nav-group-label {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint); padding: 14px 12px 6px; font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: 0.15s; margin-bottom: 2px;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: #cfe0ff; }
.nav-link.active svg { color: var(--accent); }
.nav-link.danger:hover { background: var(--danger-soft); color: var(--danger); }

.sb-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 8px 6px; }
.sb-user .av { width: 30px; height: 30px; border-radius: 50%; background: var(--elevated); overflow: hidden; flex-shrink: 0; }
.sb-user .av img { width: 100%; height: 100%; object-fit: cover; }
.sb-user .nm { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-logout {
  width: 100%; margin-top: 8px; padding: 8px; background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 12.5px; cursor: pointer; transition: 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.sb-logout:hover { border-color: var(--danger); color: var(--danger); }
.sb-logout svg { width: 15px; height: 15px; }

/* ---------- Main ---------- */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 34px 18px; gap: 20px; flex-wrap: wrap;
}
.topbar h1 { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.content { padding: 6px 34px 60px; max-width: 1120px; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.card.pad-sm { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-title-icon { display: flex; align-items: center; gap: 10px; }
.card-title-icon svg { width: 19px; height: 19px; color: var(--accent); }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* ---------- Stat tiles ---------- */
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden;
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-top: 6px; line-height: 1; }
.stat .foot { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.stat .accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.stat.good .accent-bar { background: var(--success); }
.stat.warn .accent-bar { background: var(--warn); }
.stat.bad .accent-bar { background: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--text); cursor: pointer; transition: 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--accent); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #071223; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Form controls ---------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font-family: var(--font-body); font-size: 13.5px;
  padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); transition: 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 80px; font-family: var(--font-body); }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b97ab' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--elevated); border: 1px solid var(--line-strong);
  border-radius: 999px; transition: 0.18s; cursor: pointer;
}
.switch .track::before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: var(--muted); border-radius: 50%; transition: 0.18s;
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); background: var(--accent); }

.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row-toggle:last-child { border-bottom: none; }
.row-toggle .txt .t { font-size: 13.5px; font-weight: 500; }
.row-toggle .txt .d { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; font-family: var(--font-mono); }
.badge.on { background: var(--success-soft); color: var(--success); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: var(--elevated); color: var(--muted); }

.lvl { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; font-family: var(--font-mono); }
.lvl-1 { background: var(--accent-soft); color: var(--accent); }
.lvl-2 { background: var(--warn-soft); color: var(--warn); }
.lvl-3 { background: var(--danger-soft); color: var(--danger); }
.lvl-4 { background: #3a0d16; color: #ff6b81; }

/* ---------- Tables / lists ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--elevated); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px 4px 11px; font-size: 12px; margin: 3px 4px 3px 0; }
.chip button { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.chip button:hover { color: var(--danger); }

.empty { text-align: center; padding: 40px 20px; color: var(--faint); font-size: 13px; }
.empty svg { width: 34px; height: 34px; margin-bottom: 12px; opacity: 0.5; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 9px 15px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Category filter (commands) ---------- */
.filterbar { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-pill { padding: 6px 13px; font-size: 12.5px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); cursor: pointer; transition: 0.15s; }
.filter-pill:hover { color: var(--text); }
.filter-pill.active { background: var(--accent-soft); border-color: var(--accent); color: #cfe0ff; }

/* ---------- Loading / skeleton ---------- */
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); gap: 14px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--elevated); border: 1px solid var(--line-strong);
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13px;
  box-shadow: var(--shadow); animation: slideup 0.25s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes slideup { from { transform: translateY(12px); opacity: 0; } }

/* ============================================================
   Auth / landing (index.html) + server select (servers.html)
   ============================================================ */
.center-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.auth-card {
  max-width: 420px; width: 100%; text-align: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 40px 34px; box-shadow: var(--shadow);
}
.auth-logo { width: 62px; height: 62px; margin: 0 auto 20px; color: var(--accent); }
.auth-card h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.02em; }
.auth-card .tag { color: var(--muted); font-size: 14px; margin: 10px 0 28px; }
.discord-btn {
  width: 100%; padding: 13px; background: #5865f2; border: none; border-radius: 12px;
  color: #fff; font-family: var(--font-body); font-size: 14.5px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.15s;
}
.discord-btn:hover { filter: brightness(1.08); }
.discord-btn svg { width: 20px; height: 20px; }

.select-head { text-align: center; padding: 50px 20px 30px; }
.select-head .logo { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--accent); }
.select-head h1 { font-family: var(--font-display); font-size: 28px; }
.select-head p { color: var(--muted); margin-top: 8px; }
.select-grid { max-width: 940px; margin: 0 auto; padding: 0 24px 70px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.server-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; transition: 0.18s;
}
.server-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.server-card .sicon {
  width: 62px; height: 62px; border-radius: 18px; background: var(--elevated);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  font-size: 22px; color: var(--accent); overflow: hidden; margin-bottom: 14px;
}
.server-card .sicon img { width: 100%; height: 100%; object-fit: cover; }
.server-card .sname { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.server-card .sstat { font-size: 12px; margin-bottom: 16px; }
.server-card .sstat.present { color: var(--success); }
.server-card .sstat.absent { color: var(--faint); }
.server-card .btn { width: 100%; justify-content: center; }
.select-logout { text-align: center; padding-bottom: 50px; }
.select-logout a { color: var(--faint); font-size: 13px; }
.select-logout a:hover { color: var(--danger); }
