/* SheryBot dashboard — minimal & premium. Original design, dark, restrained:
   near-black surfaces, hairline borders, one accent, crisp type, soft depth. */
:root {
  --bg: #0a0a0b;
  --surface: #131317;
  --surface-2: #1a1a20;
  --surface-3: #212129;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.13);
  --text: #ececef;
  --text-muted: #9a9aa7;
  --text-subtle: #626270;
  --accent: #7c74ff;
  --accent-hover: #948dff;
  --accent-soft: rgba(124,116,255,0.13);
  --accent-line: rgba(124,116,255,0.4);
  --success: #4ec98f;
  --danger: #f0575c;
  --warning: #e3b25a;
  --info: #6ea8fe;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-w: 244px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 10px 30px rgba(0,0,0,0.28);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.45);
  --ease: 0.15s ease;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--accent-hover); }

/* faint top vignette for depth, no motion */
body.dashboard-body::before,
body.landing::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 55% at 50% -10%, rgba(124,116,255,0.06), transparent 70%);
}

/* ── ICONS ── */
.icon { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; vertical-align: -0.18em; color: inherit; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ── USER ID TOOLTIP ── */
.user-tip { position: relative; cursor: pointer; border-bottom: 1px dotted var(--text-subtle); }
.user-tip::after {
  content: 'ID: ' attr(data-id);
  position: absolute; top: 50%; right: calc(100% + 8px); transform: translateY(-50%);
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-muted);
  padding: 4px 10px; border-radius: var(--radius-sm); font-size: 11px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity var(--ease); z-index: 20; box-shadow: var(--shadow-sm);
}
.user-tip:hover::after, .user-tip:focus::after { opacity: 1; }
.user-tip[data-copied]::after { content: 'Copied'; color: var(--success); }

code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 5px;
  font-size: 0.84em; color: #c9c6ff; border: 1px solid var(--border);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; font-size: 13px; font-weight: 550; font-family: inherit;
  letter-spacing: -0.01em; white-space: nowrap; user-select: none; position: relative;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(124,116,255,0.3); }
.btn-success { background: var(--success); color: #04140c; }
.btn-success:hover { filter: brightness(1.06); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite; top: 50%; left: 50%; margin: -7.5px 0 0 -7.5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BADGES / CHIPS ── */
.badge, .tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge-success, .tag-success { background: rgba(78,201,143,0.1); color: var(--success); border-color: rgba(78,201,143,0.22); }
.badge-danger,  .tag-danger  { background: rgba(240,87,92,0.1);  color: var(--danger);  border-color: rgba(240,87,92,0.22); }
.badge-warning, .tag-warning, .badge-warn, .tag-warn { background: rgba(227,178,90,0.1); color: var(--warning); border-color: rgba(227,178,90,0.22); }
.badge-info,    .tag-info    { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent-line); }
.badge-error,   .tag-error   { background: rgba(240,87,92,0.1);  color: var(--danger);  border-color: rgba(240,87,92,0.22); }
.badge-owner,   .tag-owner   { background: rgba(227,178,90,0.12); color: var(--warning); border-color: rgba(227,178,90,0.3); }
.badge-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(78,201,143,0.5); animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(78,201,143,0.5); } 70%, 100% { box-shadow: 0 0 0 5px rgba(78,201,143,0); } }
.music-track .music-title { font-size: 15px; margin-bottom: 2px; }
.music-meta { font-size: 13px; }
.music-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.music-queue li { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.music-queue li code { color: var(--text-muted); margin-right: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 6px;
  font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); transition: color var(--ease), border-color var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip-blue { color: var(--accent-hover); } .chip-green { color: var(--success); }
.chip-red { color: var(--danger); } .chip-yellow { color: var(--warning); }
.chip-purple { color: #b9a6ff; } .chip-cyan { color: var(--info); }

/* ── FLASH ── */
.flash-success, .flash-error {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000;
  padding: 11px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 550;
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); background: var(--surface-3);
  animation: toast-in 0.25s ease, fadeOut 0.4s ease 3.5s forwards;
}
.flash-success { color: var(--success); } .flash-error { color: var(--danger); }
.flash-out { animation: toast-out 0.3s ease forwards !important; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
@keyframes fadeOut { to { opacity: 0; } }

/* ── ALERTS ── */
.alert {
  padding: 13px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px;
  line-height: 1.6; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.alert strong { color: var(--text); font-weight: 600; }
.alert-success { border-left: 2px solid var(--success); }
.alert-danger  { border-left: 2px solid var(--danger); }
.alert-warning { border-left: 2px solid var(--warning); }
.alert-info    { border-left: 2px solid var(--accent); }

/* ── INPUTS ── */
.input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 9px 12px; width: 100%; font-size: 13px; font-family: inherit;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.input::placeholder { color: var(--text-subtle); }
.input:hover:not(:focus) { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { padding: 6px 10px; font-size: 12px; width: auto; }
.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
select.input { cursor: pointer; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 7px; letter-spacing: 0.05em; text-transform: uppercase;
}
.filters-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; padding: 12px 16px; }
.save-row { display: flex; align-items: center; gap: 14px; }
.unsaved-hint { font-size: 12px; color: var(--warning); }

/* ── CARDS ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: border-color var(--ease), box-shadow var(--ease);
}
.card:hover { border-color: var(--border-strong); }
.card-header {
  padding: 15px 20px; font-weight: 600; font-size: 11px; border-bottom: 1px solid var(--border);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-body { padding: 20px; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); transition: border-color var(--ease), transform var(--ease);
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.stat-value.small { font-size: 13px; font-weight: 550; color: var(--text-muted); font-family: ui-monospace, monospace; }

/* ── TABLES ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 18px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; transition: background var(--ease); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.nowrap { white-space: nowrap; }
.log-msg-cell { max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── LAYOUT / SIDEBAR ── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 50;
}
.sidebar-brand {
  padding: 20px 18px; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); letter-spacing: -0.01em; color: var(--text);
}
.brand-icon { color: var(--accent); display: inline-flex; }
.brand-icon .icon { width: 20px; height: 20px; }
.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-group-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-subtle); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13px; font-weight: 500; margin-bottom: 1px; position: relative;
  transition: background var(--ease), color var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-hover); }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-icon { display: inline-flex; align-items: center; color: currentColor; }
.nav-icon .icon { width: 18px; height: 18px; }
/* modules accordion */
.nav-group.expandable { margin-bottom: 1px; }
.nav-expand-header { width: 100%; background: transparent; border: none; font-family: inherit; text-align: left; cursor: pointer; }
.nav-chevron { margin-left: auto; display: inline-flex; color: var(--text-subtle); transition: transform var(--ease); }
.nav-chevron .icon { width: 16px; height: 16px; }
.nav-sub { max-height: 0; overflow: hidden; transition: max-height 0.28s ease; padding-left: 12px; }
.nav-sub .nav-item { font-size: 12.5px; padding: 7px 11px; }
.nav-group.expandable:hover .nav-sub, .nav-group.expandable.open .nav-sub, .nav-group.expandable:focus-within .nav-sub { max-height: 640px; }
.nav-group.expandable:hover .nav-chevron, .nav-group.expandable.open .nav-chevron { transform: rotate(180deg); }

.sidebar-guild {
  display: flex; align-items: center; gap: 11px; margin: 14px 12px 6px; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--ease);
}
.sidebar-guild:hover { border-color: var(--border-strong); }
.sidebar-guild-icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); flex-shrink: 0; object-fit: cover; }
.sidebar-guild-icon.placeholder { background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 15px; color: #fff; border: none; }
.sidebar-guild-meta { min-width: 0; }
.sidebar-guild-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-guild-switch { font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.sidebar-guild-switch:hover { color: var(--accent-hover); }
.sidebar-guild-switch .icon { width: 12px; height: 12px; }

.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 38px; height: 38px; padding: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.menu-toggle span { display: block; height: 1.5px; background: var(--text); border-radius: 2px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 90; }
.sidebar-backdrop.visible { display: block; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.user-avatar-sm { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); }
.user-name-sm { font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }

.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: rgba(10,10,11,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); padding: 14px 26px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.guild-icon-sm { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); }
.content-area { padding: 28px; flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.mt-4 { margin-top: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.text-muted { color: var(--text-muted); }

/* ── GUILD CARDS ── */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.guild-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color var(--ease), transform var(--ease); }
.guild-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.guild-card-main { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.guild-card-actions { display: flex; gap: 6px; padding: 0 18px; flex-wrap: wrap; max-height: 0; overflow: hidden; border-top: 0 solid var(--border); transition: max-height 0.24s ease, padding 0.24s ease, border-top-width 0.24s ease; }
.guild-card:hover .guild-card-actions { max-height: 90px; padding: 12px 18px 14px; border-top-width: 1px; }
.guild-icon { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; border: 1px solid var(--border); }
.guild-icon-placeholder { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 18px; color: var(--accent-hover); flex-shrink: 0; border: 1px solid var(--border); }
.guild-name { font-weight: 600; font-size: 14px; }
.guild-id { font-size: 11px; margin-top: 2px; color: var(--text-subtle); font-family: ui-monospace, monospace; }
.guild-list-sm { max-height: 320px; overflow-y: auto; }
.guild-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; transition: background var(--ease); }
.guild-list-item:hover { background: var(--surface-2); }
.guild-icon-xs { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border); }

/* ── LOGS ── */
.log-list { padding: 0 16px; }
.log-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.log-item:last-child { border-bottom: none; }
.log-msg { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-time { font-size: 11px; white-space: nowrap; color: var(--text-subtle); }
.log-connecting { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; color: var(--text-muted); font-size: 12.5px; }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--border); }
.pagination .btn { min-width: 34px; }
.pagination .btn.active { background: var(--accent); color: #fff; }
.page-info { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ── EMPTY STATE ── */
.empty-state { padding: 56px 24px; text-align: center; color: var(--text-subtle); }
.empty-state.small { padding: 28px; }
.empty-icon { color: var(--text-subtle); margin-bottom: 14px; display: inline-flex; }
.empty-icon .icon { width: 36px; height: 36px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── LANDING ── */
.landing { background: var(--bg); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; background: rgba(10,10,11,0.7); backdrop-filter: blur(12px); }
.nav-brand { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.nav-brand .icon { color: var(--accent); }
.hero { padding: 120px 32px 90px; text-align: center; }
.hero-title { font-size: 56px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.035em; line-height: 1.08; color: var(--text); }
.hero-title .accent, .hero-title span { color: var(--accent); }
.hero-subtitle { font-size: 18px; color: var(--text-muted); margin: 0 auto 36px; max-width: 500px; line-height: 1.6; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding: 40px 32px 80px; max-width: 980px; margin: 0 auto; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: border-color var(--ease), transform var(--ease); }
.feature-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature-icon { color: var(--accent); margin-bottom: 16px; display: inline-flex; }
.feature-icon .icon { width: 26px; height: 26px; }
.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.feature-card p { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.landing-footer { text-align: center; padding: 28px; color: var(--text-subtle); border-top: 1px solid var(--border); font-size: 13px; }

/* ── ERROR PAGES ── */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-page { text-align: center; }
.error-code { font-size: 88px; font-weight: 700; color: var(--accent); line-height: 1; letter-spacing: -0.04em; }
.error-page h1 { font-size: 22px; font-weight: 650; margin: 14px 0 8px; }
.error-page p { color: var(--text-muted); margin-bottom: 28px; }

/* ── MODULE GRID ── */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.module-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 11px; box-shadow: var(--shadow-sm); transition: border-color var(--ease), transform var(--ease); }
.module-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.module-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.module-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-hover); }
.module-icon .icon { width: 21px; height: 21px; }
.module-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.module-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; flex: 1; }
.module-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ── TOGGLE SWITCH (original minimal) ── */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 22px; cursor: pointer; transition: background var(--ease), border-color var(--ease); }
.switch .slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: var(--text-subtle); border-radius: 50%; transition: transform var(--ease), background var(--ease); }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }
.switch.loading .slider::before { animation: pulse 0.9s ease infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* ── CHANNEL PICKER + minimal checkbox ── */
.picker-row td { background: rgba(255,255,255,0.015); padding: 0 18px; }
.channel-picker { padding: 14px 4px 16px; }
.channel-picker-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.channel-picker-head .hint { font-size: 12px; color: var(--text-muted); }
.checkbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 12px; max-height: 220px; overflow-y: auto; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checkbox-list label { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); padding: 5px 6px; border-radius: 6px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkbox-list label:hover { background: rgba(255,255,255,0.03); }
.checkbox-list input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 17px; height: 17px; flex-shrink: 0;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface-3);
  cursor: pointer; position: relative; transition: background var(--ease), border-color var(--ease);
}
.checkbox-list input[type="checkbox"]:hover { border-color: var(--accent-line); }
.checkbox-list input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.checkbox-list input[type="checkbox"]:checked::after { content: ''; position: absolute; left: 5px; top: 1.5px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.channel-picker-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.channel-picker-actions .note { font-size: 11px; color: var(--text-subtle); margin-left: auto; }
.restricted-badge { cursor: default; }

/* ── FORM GRID / SETTINGS ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.form-hint { font-size: 12px; color: var(--text-subtle); margin-top: 5px; line-height: 1.5; }
.card-title-row { display: flex; align-items: center; gap: 10px; }
.range-pair { display: flex; align-items: center; gap: 8px; }
.range-pair .input { width: 90px; }
.range-pair .sep { color: var(--text-subtle); font-size: 12px; }
.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.switch-field:last-child { border-bottom: none; }
.switch-field .switch-label { font-size: 13px; font-weight: 550; }
.switch-field .switch-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }

/* ── OWNER: per-command/category server restriction picker ──
   The body opens as a floating popover so it never reflows/collides with
   the command rows around it. */
.guild-restrict { position: relative; }
.guild-restrict summary { list-style: none; }
.guild-restrict summary::-webkit-details-marker { display: none; }
.guild-restrict .guild-restrict-body {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  width: min(300px, 86vw); padding: 12px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.guild-restrict-select { width: 100%; }

/* ── LOADERS ── */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; }
.spinner-sm { width: 14px; height: 14px; }
.skeleton { color: transparent !important; background: linear-gradient(100deg, var(--surface-2) 30%, rgba(255,255,255,0.05) 50%, var(--surface-2) 70%); background-size: 200% 100%; border-radius: 6px; animation: skeleton 1.3s ease-in-out infinite; }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.stat-value.skeleton { min-width: 72px; min-height: 26px; border-radius: 8px; }
.just-updated { animation: flash-update 0.9s ease; }
@keyframes flash-update { 0% { background-color: var(--accent-soft); } 100% { background-color: transparent; } }

/* ── MODULE LOCKED ── */
.locked-icon { color: var(--warning); display: inline-flex; vertical-align: -0.2em; }
.locked-icon .icon { width: 22px; height: 22px; }

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.dashboard-body { background: var(--bg); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); z-index: 100; transition: transform 0.25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .two-col { grid-template-columns: 1fr; }
  .hero-title { font-size: 36px; }
  .content-area { padding: 18px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .module-grid { grid-template-columns: 1fr; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
