/* PixelCity Bot Dashboard — shadcn-style, self-contained (no external assets). */
:root {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #101013;
  --card-2: #16161a;
  --popover: #101013;
  --primary: #fafafa;
  --primary-fg: #09090b;
  --accent: #5865f2;
  --accent-soft: rgba(88, 101, 242, 0.14);
  --muted: #a1a1aa;
  --muted-fg: #71717a;
  --border: #232328;
  --border-soft: #1b1b20;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--border);
  background: #0c0c0f;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #5865f2, #9b5cff);
  box-shadow: var(--shadow);
}
.brand-logo { width: 34px; height: 34px; flex-shrink: 0; }
.brand h1 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-fg); padding: 8px 10px 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  font-size: 13.5px; text-align: left;
}
.nav-item:hover { background: var(--card-2); color: var(--foreground); }
.nav-item.active { background: var(--card-2); color: var(--foreground); border: 1px solid var(--border); }
.nav-item .badge { margin-left: auto; font-size: 11px; background: var(--accent-soft); color: #c7d2fe; border-radius: 999px; padding: 1px 8px; }
.nav-arrow { color: #facc15; font-weight: 700; font-size: 12.5px; letter-spacing: -1px; flex-shrink: 0; }
/* ---------- settings sections ---------- */
.section-title {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: transparent; border: 0; cursor: pointer; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-fg); padding: 12px 4px 6px;
}
.section-title::before { content: "▾"; color: #facc15; font-size: 10px; transition: transform 0.15s ease; }
.section-title.collapsed::before { transform: rotate(-90deg); }
.section-title:hover { color: var(--muted); }
.section-body { display: grid; gap: 2px; }
.main { padding: 28px 32px 64px; max-width: 1180px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
  background: var(--card); font-size: 12.5px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-fg); }
.dot.ok { background: var(--success); } .dot.bad { background: var(--danger); } .dot.warn { background: var(--warning); }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } .main { padding: 18px 16px 48px; } }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.card h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.card .big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.card .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.card h2.card-title { font-size: 15px; color: var(--foreground); margin: 0 0 10px; }

/* ---------- buttons / inputs (liquid glass) ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06)),
    linear-gradient(135deg, #fde047, #facc15);
  color: #1c1917;
  padding: 9px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 4px 18px rgba(250, 204, 21, 0.25), inset 0 1px 0 rgba(255,255,255,0.55);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 6px 24px rgba(250, 204, 21, 0.4), inset 0 1px 0 rgba(255,255,255,0.6); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: scale(0.96); }
.btn.secondary {
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03));
  color: var(--foreground);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn.secondary:hover { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn.ghost { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.btn.danger {
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05)),
    linear-gradient(135deg, #f87171, #ef4444);
  border-color: rgba(255, 255, 255, 0.16); color: #fff;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:disabled::after { display: none; }
/* ---------- progress spinner (settings applying) ---------- */
.spinner {
  width: 13px; height: 13px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(128, 128, 128, 0.35);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.discord-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.05)),
    linear-gradient(135deg, #6b76f5, #5865f2);
  color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 12px;
  padding: 12px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 6px 24px rgba(88, 101, 242, 0.45), inset 0 1px 0 rgba(255,255,255,0.4);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.discord-btn:hover { box-shadow: 0 8px 32px rgba(88, 101, 242, 0.6), inset 0 1px 0 rgba(255,255,255,0.45); }
.discord-btn:active { transform: scale(0.97); }
.input, .select, .textarea {
  width: 100%; background: #0c0c0f; border: 1px solid var(--border);
  color: var(--foreground); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13.5px;
}
.textarea { min-height: 96px; resize: vertical; font-family: inherit; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.switch-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: #27272a; border-radius: 999px; transition: background 0.15s; pointer-events: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.tab {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.tab:hover { color: var(--foreground); background: var(--card-2); }
.tab.active { color: var(--foreground); background: var(--card-2); border-color: var(--border); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-fg); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.chip { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--border); background: var(--card-2); }
.chip.green { color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
.chip.red { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.chip.amber { color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.chip.blue { color: #c7d2fe; border-color: rgba(88, 101, 242, 0.45); }

/* ---------- sign in ---------- */
.center { max-width: 560px; margin: 12vh auto; text-align: center; }
.server-list { display: grid; gap: 10px; margin-top: 18px; text-align: left; }
.server-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.server-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.server-icon img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- discord embed preview ---------- */
.embed-preview { background: #2b2d31; border-left: 4px solid #5865f2; border-radius: 6px; padding: 12px 14px; color: #dbdee1; }
.embed-preview .e-title { font-weight: 700; color: #fff; margin-bottom: 6px; }
.embed-preview .e-body { white-space: pre-wrap; font-size: 13.5px; }

/* ---------- misc ---------- */
.alert { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px; }
.alert.error { border-left-color: var(--danger); }
.alert.ok { border-left-color: var(--success); }
.alert .muted { color: var(--muted); }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13.5px; z-index: 50; }
.boot { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18vh 20px; color: var(--muted); }
.boot-mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #fff, #facc15); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.main > * { animation: rise-in 0.25s ease both; }
.main > *:nth-child(2) { animation-delay: 0.04s; }
.main > *:nth-child(3) { animation-delay: 0.08s; }
.main > *:nth-child(4) { animation-delay: 0.12s; }
.card { transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.15s ease; }
.card:hover { border-color: #3a3a42; }
.toast {
  animation: toast-in 0.22s ease both;
  background: rgba(22, 22, 26, 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.12);
}
.nav-item { transition: background 0.15s ease, transform 0.12s ease; }
.nav-item:active { transform: scale(0.98); }
.tab { transition: background 0.15s ease, color 0.15s ease; }
.server-row { transition: transform 0.15s ease, border-color 0.15s ease; }
.server-row:hover { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  .main > *, .toast { animation: none; }
  .btn, .discord-btn, .card, .nav-item, .tab, .server-row { transition: none; }
  .btn::after { display: none; }
  .boot-mark { animation: none; }
  .spinner { animation: none; border-top-color: rgba(128, 128, 128, 0.35); }
}
canvas.chart { width: 100%; height: 180px; display: block; }
.search { max-width: 320px; }
.footer { margin-top: 40px; color: var(--muted-fg); font-size: 12.5px; }
code.inline { background: var(--card-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
