/* ==========================================================================
   Circuit dashboard v3 — refined dark UI.
   Brand: cyan chip on deep navy. Every class name the older templates use
   (card, grid, stat, row, pill, flash, table, who, lb, gw, fold…) is kept,
   so all pages pick up the new look without being rewritten.
   ========================================================================== */
:root {
  --bg: #050813;
  --bg-2: #080c19;
  --panel: #0d1322;
  --panel-2: #121a2d;
  --panel-3: #19233a;
  --border: #1e2942;
  --border-soft: #172037;
  --border-glow: rgba(56, 224, 255, 0.28);
  --text: #eaf0fb;
  --text-dim: #b4bed4;
  --muted: #7f8aa6;
  --accent: #2fa8ff;
  --accent-2: #38e0ff;
  --accent-soft: rgba(47, 168, 255, 0.12);
  --accent-hover: #1d8de6;
  --danger: #ff4d5e;
  --danger-hover: #dc3b4b;
  --danger-soft: rgba(255, 77, 94, 0.12);
  --success: #3ddc84;
  --success-soft: rgba(61, 220, 132, 0.12);
  --warn: #ffb84d;
  --warn-soft: rgba(255, 184, 77, 0.12);
  --gold: #ffd166;
  --blurple: #5865f2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.38);
  --ring: 0 0 0 3px rgba(47, 168, 255, 0.28);
  --sidebar-w: 260px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(47, 168, 255, 0.13), transparent 60%),
    radial-gradient(800px 480px at 105% 0%, rgba(56, 224, 255, 0.07), transparent 55%),
    radial-gradient(700px 500px at 50% 120%, rgba(88, 101, 242, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
/* faint circuit-board grid */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 224, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 224, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 20% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 20% 0%, #000 0%, transparent 70%);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--panel-2); border: 1px solid var(--border-soft); padding: 1px 7px; border-radius: 6px; font-size: 0.85em; color: var(--accent-2); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
::selection { background: rgba(47, 168, 255, 0.35); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* nicer scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

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

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(8, 12, 25, 0.92), rgba(13, 19, 34, 0.96));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform 0.25s var(--ease);
}
.sidebar-head { padding: 20px 18px 8px; }
.brand-logo { display: block; width: 100%; max-width: 168px; height: auto; filter: drop-shadow(0 0 12px rgba(47, 168, 255, 0.45)); }

/* current server chip */
.guild-chip {
  margin: 14px 12px 4px; padding: 11px 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700;
}
.guild-chip strong { display: block; margin-top: 3px; color: var(--text); font-size: 0.95rem; text-transform: none; letter-spacing: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-chip .prefix-chip { margin-top: 7px; }
.guild-switcher { margin: 9px 0 0; }
.guild-switcher select { font-size: 0.85rem; padding: 7px 9px; text-transform: none; letter-spacing: 0; font-weight: 500; }

.nav { flex: 1; overflow-y: auto; padding: 6px 10px 14px; }
.nav-group { margin-top: 14px; }
.nav-title { padding: 0 11px 6px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #566283; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; margin-bottom: 2px;
  color: var(--muted); border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 550;
  transition: background 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; transform: translateX(2px); }
.nav a.active { background: linear-gradient(90deg, rgba(47, 168, 255, 0.18), rgba(47, 168, 255, 0.02)); color: var(--accent-2); }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 20%; bottom: 20%; width: 3px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 12px var(--accent); }
.nav a .ico { width: 22px; text-align: center; font-size: 1.04rem; }
.nav a .badge { margin-left: auto; }

.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); background: rgba(5, 8, 19, 0.5); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 4px; }
.user-chip img, .user-chip .avatar { width: 32px; height: 32px; }
.user-chip .un { font-weight: 650; font-size: 0.88rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .us { color: var(--muted); font-size: 0.72rem; }
.sidebar-foot a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.86rem; font-weight: 550; }
.sidebar-foot a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar-foot a.logout:hover { color: var(--danger); }

.content { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.mobilebar { display: none; }
main { max-width: 1080px; margin: 0 auto; padding: 34px 32px 80px; animation: rise 0.45s var(--ease) both; }
.scrim { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes shimmer { to { background-position: 200% 0; } }

/* --------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 0.93rem; max-width: 60ch; }
h1 { font-size: 1.85rem; line-height: 1.15; margin: 0; letter-spacing: -0.025em; font-weight: 800; background: linear-gradient(180deg, #fff, #b9c7e6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 1.05rem; margin: 0 0 12px; letter-spacing: -0.01em; font-weight: 700; }
h3 { font-size: 0.72rem; color: var(--muted); margin: 20px 0 8px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
main > h1 { margin-bottom: 22px; }

/* --------------------------------------------------------------- cards */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 26, 45, 0.78), rgba(13, 19, 34, 0.82));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card.glow { border-color: var(--border-glow); box-shadow: var(--shadow), 0 0 0 1px rgba(56, 224, 255, 0.05), 0 0 50px rgba(47, 168, 255, 0.08); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols-wrap { margin-bottom: 20px; }

/* --------------------------------------------------------------- stats */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  position: relative; overflow: hidden; display: block; color: inherit;
  background: linear-gradient(180deg, rgba(25, 35, 58, 0.7), rgba(13, 19, 34, 0.85));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 16px;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
a.stat:hover { transform: translateY(-3px); border-color: var(--border-glow); box-shadow: 0 12px 34px rgba(47, 168, 255, 0.12); text-decoration: none; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0.9; }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 168, 255, 0.14), transparent 70%); pointer-events: none; }
.stat .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 0.74rem; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat.gold::before { background: linear-gradient(90deg, #ffb703, var(--gold)); }
.stat.gold::after { background: radial-gradient(circle, rgba(255, 209, 102, 0.16), transparent 70%); }
.stat.gold .num { color: var(--gold); }
.stat.green::before { background: var(--success); }
.stat.red::before { background: var(--danger); }
.stat.red::after { background: radial-gradient(circle, rgba(255, 77, 94, 0.16), transparent 70%); }

/* --------------------------------------------------------------- forms */
label { display: block; font-size: 0.78rem; font-weight: 650; color: var(--text-dim); margin: 14px 0 6px; letter-spacing: 0.01em; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%;
  background: rgba(5, 8, 19, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: #53607f; }
input:hover, select:hover, textarea:hover { border-color: #2b3a5e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: rgba(5, 8, 19, 0.95); }
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237f8aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
select[multiple] { min-height: 150px; padding: 6px; background-image: none; }
select[multiple] option { padding: 5px 8px; border-radius: 5px; }
select[multiple] option:checked { background: var(--accent); color: #031019; }
input[type=number] { appearance: textfield; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(180deg, #38b0ff, var(--accent-hover));
  color: #04101c; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 9px 17px; font-size: 0.9rem; font-weight: 700; font-family: inherit;
  cursor: pointer; margin-top: 12px; line-height: 1.3;
  box-shadow: 0 4px 16px rgba(47, 168, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s var(--ease), filter 0.15s, box-shadow 0.15s, border-color 0.15s;
}
button:hover, .btn:hover { filter: brightness(1.09); text-decoration: none; box-shadow: 0 6px 22px rgba(47, 168, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
button:active, .btn:active { transform: translateY(1px) scale(0.99); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger, .btn.danger { background: linear-gradient(180deg, #ff6676, var(--danger-hover)); color: #fff; box-shadow: 0 4px 16px rgba(255, 77, 94, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
button.secondary, .btn.secondary { background: var(--panel-3); border-color: var(--border); color: var(--text); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { border-color: var(--accent); filter: none; box-shadow: none; }
button.ghost, .btn.ghost { background: transparent; border-color: var(--border); color: var(--text-dim); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--accent); color: var(--text); box-shadow: none; filter: none; }
button.small, .btn.small { padding: 6px 12px; font-size: 0.8rem; margin-top: 0; }
.btn-discord { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--blurple); color: #fff; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 6px 22px rgba(88, 101, 242, 0.38); }
.btn-discord:hover { filter: brightness(1.1); box-shadow: 0 8px 28px rgba(88, 101, 242, 0.5); }
.btn-add { background: linear-gradient(180deg, #43e6a0, #25b873); color: #03150d; box-shadow: 0 4px 16px rgba(61, 220, 132, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { margin-top: 0; }
.row > input, .row > select { flex: 1 1 140px; width: auto; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
form.inline { display: inline; margin: 0; }
form.inline button { margin-top: 0; }

/* toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.switch-row:last-child { border-bottom: none; }
.switch-row .sw-text strong { display: block; font-size: 0.92rem; font-weight: 650; }
.switch-row .sw-text span { color: var(--muted); font-size: 0.82rem; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--panel-3); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: 0.22s var(--ease); }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #8e9bbb; border-radius: 50%; transition: 0.22s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.switch input:checked + .slider { background: rgba(47, 168, 255, 0.22); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }

/* ---------------------------------------------------------- lists/tables */
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
ul.list li:last-child { border-bottom: none; }

.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table th, table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table th { color: var(--muted); font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em; white-space: nowrap; }
table tr:last-child td { border-bottom: none; }
table tbody tr { transition: background 0.12s; }
table tbody tr:hover td { background: rgba(47, 168, 255, 0.05); }

.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--panel-3); border: 1px solid var(--border); border-radius: 999px; padding: 2px 11px; font-size: 0.74rem; font-weight: 650; color: var(--muted); white-space: nowrap; line-height: 1.6; }
a.pill:hover { text-decoration: none; filter: brightness(1.2); }
.pill.green { color: var(--success); background: var(--success-soft); border-color: rgba(61, 220, 132, 0.35); }
.pill.red { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 77, 94, 0.35); }
.pill.blue { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(47, 168, 255, 0.35); }
.pill.gold { color: var(--gold); background: rgba(255, 209, 102, 0.12); border-color: rgba(255, 209, 102, 0.35); }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(255, 184, 77, 0.35); }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: pulse 2s infinite; }

.prefix-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; letter-spacing: 0.02em; text-transform: none; color: var(--muted); font-weight: 600; }
.prefix-chip kbd, kbd.prefix { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.82rem; color: var(--accent-2); background: var(--accent-soft); border: 1px solid rgba(47, 168, 255, 0.35); border-radius: 6px; padding: 0 7px; line-height: 1.6; }

.flash { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 15px; margin-bottom: 18px; font-size: 0.9rem; border: 1px solid; animation: rise 0.35s var(--ease) both; backdrop-filter: blur(8px); }
.flash::before { font-weight: 800; }
.flash.success { background: var(--success-soft); border-color: rgba(61, 220, 132, 0.45); color: #98f2c0; }
.flash.success::before { content: "✓"; }
.flash.error { background: var(--danger-soft); border-color: rgba(255, 77, 94, 0.5); color: #ffadb5; }
.flash.error::before { content: "!"; }
.flash.info { background: var(--accent-soft); border-color: rgba(47, 168, 255, 0.4); color: #a9dcff; }
.flash.hide { opacity: 0; transform: translateY(-6px); transition: 0.4s; }

.muted { color: var(--muted); font-size: 0.86rem; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty .big { font-size: 2rem; display: block; margin-bottom: 6px; filter: grayscale(0.2); }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ------------------------------------------------- people / leaderboard */
.who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel-3); border: 1px solid var(--border); flex: none; }
.avatar.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.avatar.sm { width: 26px; height: 26px; font-size: 0.7rem; }
.who .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .sub { display: block; color: var(--muted); font-size: 0.74rem; font-weight: 400; }

.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--border-soft); position: relative; border-radius: 8px; transition: background 0.12s; }
.lb li:hover { background: rgba(47, 168, 255, 0.04); }
.lb li:last-child { border-bottom: none; }
.lb .rank { font-weight: 800; color: var(--muted); text-align: center; font-size: 1rem; }
.lb li:nth-child(1) .rank { color: var(--gold); font-size: 1.3rem; text-shadow: 0 0 14px rgba(255, 209, 102, 0.5); }
.lb li:nth-child(2) .rank { color: #d3dbea; font-size: 1.18rem; }
.lb li:nth-child(3) .rank { color: #e6a066; font-size: 1.1rem; }
.lb .bar { height: 5px; background: var(--panel-3); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.lb .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }
.lb li:nth-child(1) .bar > span { background: linear-gradient(90deg, #ffb703, var(--gold)); }
.lb .pts { font-weight: 800; font-size: 1.12rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb .pts small { display: block; color: var(--muted); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.tabs-inline { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs-inline a { padding: 6px 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; font-weight: 650; transition: 0.15s; }
.tabs-inline a:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.tabs-inline a.active { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #031019; border-color: transparent; box-shadow: 0 4px 16px rgba(47, 168, 255, 0.28); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.88rem; }
.feed li:last-child { border-bottom: none; }
.feed .when { margin-left: auto; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.kv > div { background: rgba(5, 8, 19, 0.5); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; }
.kv b { display: block; font-size: 1.2rem; }
.kv span { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }

.gw { border: 1px solid var(--border); background: linear-gradient(180deg, rgba(25, 35, 58, 0.55), rgba(13, 19, 34, 0.6)); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; transition: border-color 0.2s; }
.gw:hover { border-color: #2b3a5e; }
.gw-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.gw h3 { margin: 0; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); }
.gw-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 9px 0 4px; }
.gw-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.gw-actions form { display: inline-flex; gap: 6px; align-items: center; }
.gw-actions input { width: 90px; padding: 6px 9px; font-size: 0.82rem; }

details.fold { border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(5, 8, 19, 0.55); padding: 0 15px; margin-top: 12px; }
details.fold > summary { cursor: pointer; padding: 12px 0; font-weight: 650; font-size: 0.9rem; list-style: none; color: var(--text); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; display: inline-block; margin-right: 9px; color: var(--accent); transition: transform 0.18s var(--ease); }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold[open] { padding-bottom: 15px; }
details.danger-zone { border-color: rgba(255, 77, 94, 0.4); }
details.danger-zone > summary { color: #ff9aa4; }

/* ---------------------------------------------------- your-servers page */
.hero-card { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 24px 26px; margin-bottom: 22px; }
.hero-card .hero-text { flex: 1 1 280px; }
.hero-card h2 { font-size: 1.25rem; margin-bottom: 6px; }
.hero-card p { margin: 0; color: var(--muted); }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search input { padding-left: 38px; }
.toolbar .search::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.2rem; pointer-events: none; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.server-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(180deg, rgba(25, 35, 58, 0.6), rgba(13, 19, 34, 0.85));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
  animation: rise 0.45s var(--ease) both;
}
.server-card:hover { transform: translateY(-3px); border-color: var(--border-glow); box-shadow: 0 14px 40px rgba(47, 168, 255, 0.11); }
.server-card.has-bot::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--success), var(--accent-2)); }
.server-card.is-blocked { opacity: 0.7; }
.server-card .sc-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.guild-ico { width: 52px; height: 52px; border-radius: 16px; flex: none; object-fit: cover; background: linear-gradient(135deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent-2); font-size: 1.15rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.server-card .sc-name { font-weight: 700; font-size: 1.02rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card .sc-sub { color: var(--muted); font-size: 0.78rem; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.server-card .sc-body { display: flex; flex-direction: column; gap: 10px; }
.prefix-form { display: flex; align-items: center; gap: 8px; }
.prefix-form label { margin: 0; white-space: nowrap; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.prefix-form input[type=text] { width: 86px; flex: none; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1rem; font-weight: 700; color: var(--accent-2); padding: 7px 8px; }
.prefix-form button { margin: 0; padding: 7px 13px; }
.sc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.sc-actions .btn, .sc-actions button { margin: 0; }
.sc-actions form { margin: 0; }
.server-card .hint { font-size: 0.76rem; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; color: var(--muted); font-size: 0.8rem; }

/* ------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; width: 640px; height: 640px; left: 50%; top: 50%; transform: translate(-50%, -58%); background: radial-gradient(circle, rgba(47, 168, 255, 0.2), transparent 62%); filter: blur(10px); pointer-events: none; }
.login-card { position: relative; width: 100%; max-width: 410px; text-align: center; padding: 34px 30px 28px; animation: rise 0.6s var(--ease) both; }
.login-logo { width: 100%; max-width: 250px; height: auto; object-fit: contain; margin: 0 auto 14px; display: block; filter: drop-shadow(0 0 22px rgba(47, 168, 255, 0.55)); }
.login-card h1 { font-size: 1.35rem; margin: 6px 0 6px; -webkit-text-fill-color: var(--text); background: none; }
.login-card p { margin: 0 0 20px; }
.login-card .btn-discord { width: 100%; padding: 13px 16px; font-size: 0.98rem; margin-top: 4px; }
.login-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 9px; text-align: left; font-size: 0.84rem; color: var(--muted); }
.login-points li { display: flex; gap: 10px; align-items: flex-start; }
.login-points li::before { content: "◆"; color: var(--accent); font-size: 0.7rem; margin-top: 5px; }
.login-divider { display: flex; align-items: center; color: var(--muted); font-size: 0.8rem; margin: 16px 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-bottom: 1px solid var(--border); }
.login-divider span { padding: 0 10px; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); width: min(300px, 86vw); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(2, 5, 12, 0.7); backdrop-filter: blur(3px); z-index: 30; }
  .content { margin-left: 0; }
  .mobilebar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 20;
    padding: 10px 14px;
    background: rgba(8, 12, 25, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .mobilebar button { margin: 0; padding: 7px 12px; font-size: 1.1rem; line-height: 1; }
  .mobilebar img { height: 28px; width: auto; filter: drop-shadow(0 0 8px rgba(47, 168, 255, 0.4)); }
  .mobilebar .mb-guild { margin-left: auto; color: var(--muted); font-size: 0.82rem; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 20px 14px 60px; }
  .cols { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .card { padding: 17px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .stat .num { font-size: 1.55rem; }
  .lb li { grid-template-columns: 30px 1fr auto; gap: 8px; }
  .server-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* checkboxes pick up the accent colour */
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; vertical-align: middle; cursor: pointer; }

/* ---------------------------------------------------- plain login pages
   Flat on purpose: no glow, no gradients, no entrance animation. */
.plain-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.plain-box { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 24px 22px 20px; }
.plain-logo { display: block; width: 150px; height: auto; margin: 0 0 14px; }
.plain-box h1 { font-size: 1.1rem; font-weight: 600; margin: 0 0 14px; background: none; -webkit-text-fill-color: var(--text); color: var(--text); }
.plain-box label { margin: 12px 0 5px; font-weight: 500; }
.plain-box input[type=email], .plain-box input[type=password], .plain-box input[type=text],
.plain-box input:not([type]) { width: 100%; padding: 10px 11px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.plain-box input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); box-shadow: none; }
.plain-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 0.93rem; cursor: pointer; text-decoration: none; box-shadow: none; }
.plain-btn:hover { border-color: var(--text-dim); text-decoration: none; filter: none; }
.plain-btn.solid { background: var(--accent); border-color: var(--accent); color: #04101c; font-weight: 600; }
.plain-btn.solid:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.plain-btn.discord { background: var(--blurple); border-color: var(--blurple); color: #fff; }
.plain-btn.discord:hover { filter: brightness(1.08); }
.plain-btn:disabled { opacity: 0.5; cursor: default; }
.plain-help { color: var(--muted); font-size: 0.82rem; line-height: 1.5; margin: 10px 0 0; }
.plain-link { display: inline-block; margin-top: 14px; font-size: 0.84rem; color: var(--text-dim); }
.plain-note { border-left: 3px solid var(--border); padding: 7px 10px; margin: 0 0 12px; font-size: 0.86rem; background: var(--bg); }
.plain-note.error { border-color: var(--danger); }
.plain-note.success { border-color: var(--success); }
.plain-note.info { border-color: var(--accent); }
.plain-more { margin-top: 16px; font-size: 0.86rem; }
.plain-more summary { cursor: pointer; color: var(--text-dim); }

/* account security section */
.sec-block { padding: 16px 0; border-top: 1px solid var(--border); }
.sec-block:first-of-type { border-top: 0; padding-top: 4px; }
.sec-block h3 { font-size: 0.98rem; margin: 0 0 4px; }
.sec-block form { margin-top: 10px; }
.sec-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.sec-row > div { flex: 1 1 180px; }
.sec-list { list-style: none; padding: 0; margin: 10px 0 0; }
.sec-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-soft); font-size: 0.9rem; }
.sec-list li:first-child { border-top: 0; }
.sec-codes { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; line-height: 1.8; columns: 2; margin: 10px 0; }
.sec-qr { background: #fff; padding: 8px; display: inline-block; border-radius: 4px; }
.sec-qr svg { display: block; width: 180px; height: 180px; }
.sec-secret { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
