/* ══════════════════════════════════════════════
   DESIGN SYSTEM — MC AFK Bot Launcher UI
   Inspired by Minecraft launcher gaming aesthetic
   ══════════════════════════════════════════════ */

/* ── Color Tokens ───────────────────────────────────── */
:root {
  /* Blue-green primary */
  --teal:        #00d4aa;
  --teal-dark:   #00a882;
  --blue:        #0095ff;
  --blue-dark:   #0070cc;
  --gradient:    linear-gradient(135deg, #00d4aa 0%, #0095ff 100%);
  --grad-btn:    linear-gradient(135deg, #00c49a 0%, #0088ee 100%);

  /* Dark mode (default) */
  --bg:          #080818;
  --bg2:         #0d0d22;
  --surface:     rgba(255,255,255,0.05);
  --surface2:    rgba(255,255,255,0.08);
  --surface3:    rgba(255,255,255,0.12);
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(0,212,170,0.25);
  --text:        #ffffff;
  --text2:       rgba(255,255,255,0.7);
  --muted:       rgba(255,255,255,0.4);
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --card-bg:     rgba(255,255,255,0.05);
  --card-hover:  rgba(255,255,255,0.09);
  --console-bg:  rgba(0,0,0,0.6);
  --danger:      #ff4d6a;
  --success:     #00d4aa;
  --warn:        #ffb800;
  --sidebar-w:   260px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
}

/* ── Light Mode ─────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #eef2ff;
  --bg2:         #e4eaf8;
  --surface:     rgba(255,255,255,0.85);
  --surface2:    rgba(255,255,255,0.95);
  --surface3:    rgba(200,210,255,0.5);
  --border:      rgba(0,0,80,0.1);
  --border2:     rgba(0,150,255,0.3);
  --text:        #0d0d2e;
  --text2:       rgba(13,13,46,0.75);
  --muted:       rgba(13,13,46,0.45);
  --shadow:      0 8px 32px rgba(0,0,100,0.12);
  --card-bg:     rgba(255,255,255,0.9);
  --card-hover:  rgba(255,255,255,1);
  --console-bg:  #0d0d1f;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  transition: background .3s, color .3s;
}

a { color: inherit; text-decoration: none; }
input, select, button, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,212,170,0.3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ── Background (animated gradient) ────────────────── */
.bg-animated {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,150,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0,212,170,0.10) 0%, transparent 60%),
    radial-gradient(ellipse at 60% 80%, rgba(124,58,237,0.08) 0%, transparent 60%),
    var(--bg);
}
[data-theme="light"] .bg-animated {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,150,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0,212,170,0.07) 0%, transparent 60%),
    var(--bg);
}

/* ── Glass card ─────────────────────────────────────── */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.glass:hover { background: var(--card-hover); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.2rem; border-radius: var(--radius); font-weight: 600;
  transition: all .2s; white-space: nowrap; font-size: .85rem;
}
.btn-primary {
  background: var(--grad-btn); color: #fff;
  box-shadow: 0 4px 16px rgba(0,212,170,0.3);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,212,170,0.4); }
.btn-ghost {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface3); border-color: var(--border2); }
.btn-success { background: rgba(0,212,170,0.15); color: var(--teal); border: 1px solid rgba(0,212,170,0.3); }
.btn-success:hover { background: rgba(0,212,170,0.25); }
.btn-danger { background: rgba(255,77,106,0.15); color: var(--danger); border: 1px solid rgba(255,77,106,0.3); }
.btn-danger:hover { background: rgba(255,77,106,0.25); }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.btn-sm { padding: .4rem .85rem; font-size: .78rem; border-radius: 8px; }
.btn-full { width: 100%; }

/* ── Form controls ──────────────────────────────────── */
.form-group { margin-bottom: .9rem; }
.form-group label {
  display: block; margin-bottom: .35rem;
  font-size: .73rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.form-control {
  width: 100%; padding: .6rem .9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.15);
}
select.form-control { cursor: pointer; }
select.form-control option { background: #1a1a3a; color: #fff; }
[data-theme="light"] select.form-control option { background: #fff; color: #0d0d2e; }

.alert { padding: .65rem .9rem; border-radius: var(--radius); margin-bottom: .9rem; font-size: .83rem; }
.alert-danger { background: rgba(255,77,106,.12); border: 1px solid rgba(255,77,106,.3); color: #ff8fa3; }

/* ── Status dots ────────────────────────────────────── */
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; transition: background .4s; }
.dot.online      { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.dot.offline     { background: var(--danger); }
.dot.connecting  { background: var(--warn); box-shadow: 0 0 6px var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.85)} }

/* ── Badge ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 99px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-admin  { background: rgba(0,150,255,.15); color: var(--blue); }
.badge-client { background: rgba(0,212,170,.12); color: var(--teal); }
.badge-online  { background: rgba(0,212,170,.15); color: var(--teal); }
.badge-offline { background: rgba(255,77,106,.15); color: var(--danger); }

/* ══ AUTH PAGE ══════════════════════════════════════ */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
}
.auth-card {
  width: 400px; max-width: 95vw;
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow), 0 0 60px rgba(0,212,170,.08);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-icon {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto .9rem;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; box-shadow: 0 8px 24px rgba(0,212,170,0.35);
}
.auth-logo h1 { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.auth-logo p { color: var(--muted); font-size: .83rem; margin-top: .25rem; }
.theme-toggle-auth {
  position: absolute; top: 1.25rem; right: 1.25rem;
}

/* ══ APP SHELL ══════════════════════════════════════ */
.app-shell {
  display: flex; height: 100vh; overflow: hidden;
}

/* ══ SIDEBAR ════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w); display: flex; flex-direction: column;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  overflow: hidden; flex-shrink: 0;
  transition: width .3s;
}
.sidebar-brand {
  padding: 1.1rem 1.1rem .75rem;
  display: flex; align-items: center; gap: .65rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .brand-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--gradient); display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0,212,170,0.3);
}
.sidebar-brand .brand-text { font-weight: 800; font-size: .95rem; color: var(--text); line-height: 1.1; }
.sidebar-brand .brand-sub  { font-size: .68rem; color: var(--muted); font-weight: 500; }

.sidebar-user {
  padding: .75rem 1.1rem;
  display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-user .avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--gradient); display: flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: .82rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .user-role { font-size: .68rem; color: var(--muted); }

.sidebar-label {
  padding: .85rem 1.1rem .35rem;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
}

.sidebar-list { flex: 1; overflow-y: auto; padding: .3rem .6rem; }

.sidebar-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .65rem; border-radius: 10px; cursor: pointer;
  transition: all .18s; margin-bottom: 2px;
  position: relative;
}
.sidebar-item:hover { background: var(--surface2); }
.sidebar-item.active {
  background: rgba(0,212,170,0.12);
  border: 1px solid rgba(0,212,170,0.2);
}
.sidebar-item.active .item-name { color: var(--teal); }
.sidebar-item .item-info { flex: 1; min-width: 0; }
.sidebar-item .item-name {
  font-size: .86rem; font-weight: 600; color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-item .item-sub { font-size: .68rem; color: var(--muted); margin-top: 1px; }

.sidebar-footer {
  padding: .75rem .6rem;
  border-top: 1px solid var(--border);
  display: flex; gap: .4rem;
}

/* ══ MAIN CONTENT ═══════════════════════════════════ */
.main-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  padding: .7rem 1.4rem; height: 52px;
  display: flex; align-items: center; gap: .75rem;
  background: var(--card-bg); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-title { font-weight: 700; font-size: .95rem; flex: 1; }
.topbar-status { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); }

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .75rem; color: var(--muted); padding: 2rem;
}
.empty-state .empty-icon {
  width: 80px; height: 80px; border-radius: 24px;
  background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-size: 2.2rem;
  border: 1px solid var(--border);
}
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text2); }
.empty-state p  { font-size: .82rem; text-align: center; max-width: 240px; }

/* ── Bot detail pane ────────────────────────────────── */
.bot-pane {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; padding: 1.1rem; gap: .85rem;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  transition: border-color .2s;
}
.card:hover { border-color: var(--border2); }
.card-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem;
  display: flex; align-items: center; gap: .5rem;
}
.card-title::before {
  content: ''; display: block; width: 3px; height: 14px;
  background: var(--gradient); border-radius: 2px;
}

/* ── Server row ─────────────────────────────────────── */
.server-row { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.server-row .field { display: flex; flex-direction: column; gap: .3rem; }
.server-row .field label { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.server-row .field.host { flex: 1; min-width: 180px; }
.server-row .field.port { width: 95px; }
.server-row .btns { display: flex; gap: .45rem; align-items: flex-end; }

/* ── Action buttons ─────────────────────────────────── */
.actions-row { display: flex; gap: .55rem; flex-wrap: wrap; }
.action-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: .3rem; padding: .65rem 1rem; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); font-size: .75rem; font-weight: 600;
  transition: all .2s; cursor: pointer; min-width: 72px;
}
.action-btn .action-icon { font-size: 1.2rem; }
.action-btn .action-sub { font-size: .65rem; font-weight: 700; letter-spacing: .04em; opacity: .7; }
.action-btn:hover {
  background: rgba(0,212,170,0.12);
  border-color: rgba(0,212,170,0.3);
  color: var(--teal); transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,212,170,0.15);
}
.action-btn.active {
  background: rgba(0,212,170,0.15);
  border-color: rgba(0,212,170,0.5);
  color: var(--teal);
}
.action-btn.active .action-sub { opacity: 1; color: var(--teal); }

/* ── Console ────────────────────────────────────────── */
.console-card {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s;
}
.console-card:hover { border-color: var(--border2); }
.console-header {
  padding: .65rem 1rem; display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.console-header .card-title { margin-bottom: 0; }
.console-dots { display: flex; gap: .35rem; margin-right: .4rem; }
.console-dots span { width: 10px; height: 10px; border-radius: 50%; }
.console-dots .d1 { background: var(--danger); }
.console-dots .d2 { background: var(--warn); }
.console-dots .d3 { background: var(--teal); }
.console-actions { margin-left: auto; display: flex; gap: .35rem; }
.console {
  flex: 1; overflow-y: auto; padding: .75rem 1rem;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: .76rem; line-height: 1.6; background: var(--console-bg);
  color: rgba(200,230,255,0.85);
}
.log-line { white-space: pre-wrap; word-break: break-all; padding: 1px 0; }
.log-line.sys   { color: rgba(150,180,220,.6); }
.log-line.err   { color: #ff8fa3; }
.log-line.act   { color: var(--teal); }
.log-line.chat  { color: #ffd166; }

/* ══ ADMIN LAYOUT ════════════════════════════════════ */
.admin-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.admin-nav {
  height: 54px; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  background: var(--card-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.admin-nav .brand {
  display: flex; align-items: center; gap: .55rem; margin-right: auto;
}
.admin-nav .brand-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; box-shadow: 0 2px 10px rgba(0,212,170,.3);
}
.admin-nav .brand-name { font-weight: 800; font-size: .9rem; }

.nav-pills { display: flex; align-items: center; gap: .35rem; }
.nav-controls {
  display: flex; align-items: center; gap: .5rem; margin-left: auto;
}
.nav-controls #userLabel { font-size: .78rem; color: var(--muted); }

.nav-pill {
  padding: .35rem .85rem; border-radius: 99px; font-size: .82rem;
  font-weight: 600; cursor: pointer; border: none;
  background: transparent; color: var(--muted); transition: all .2s;
}
.nav-pill:hover { color: var(--text); background: var(--surface2); }
.nav-pill.active { background: var(--gradient); color: #fff; box-shadow: 0 3px 12px rgba(0,212,170,.3); }

.admin-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
}
.section-header h2 { font-size: 1.1rem; font-weight: 800; flex: 1; }
.section-header h2 span { color: var(--teal); }

/* ── Table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th {
  padding: .7rem 1rem; text-align: left;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
th:first-child { border-radius: var(--radius-lg) 0 0 0; }
th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
.table-card {
  background: var(--card-bg); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}

/* ══ MODAL ═══════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,20,0.75); backdrop-filter: blur(6px);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.75rem;
  width: 500px; max-width: 95vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,212,170,0.1);
  animation: modalIn .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn { from { opacity:0; transform:scale(.94) translateY(8px); } to { opacity:1; transform:none; } }
.modal h3 { font-size: 1rem; font-weight: 800; margin-bottom: 1.25rem; display: flex; align-items: center; gap: .6rem; }
.modal h3 .modal-icon { font-size: 1.1rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }
.modal-divider { height: 1px; background: var(--border); margin: .9rem 0; }

/* ── Toggle ─────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; gap: .75rem; }
.toggle-row span { font-size: .85rem; font-weight: 600; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--surface3);
  border-radius: 99px; cursor: pointer; transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--gradient); }
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Proxy grid ─────────────────────────────────────── */
.proxy-fields { margin-top: .75rem; }
.proxy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.proxy-grid .full { grid-column: 1/-1; }

/* ── Theme toggle button ─────────────────────────────── */
.theme-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); font-size: 1rem; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
  transition: all .2s; flex-shrink: 0;
}
.theme-btn:hover { background: var(--surface3); color: var(--text); border-color: var(--border2); }

/* ── Gradient text ───────────────────────────────────── */
.grad-text {
  background: var(--gradient); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── Hamburger & Overlay (hidden on desktop) ─────────── */
.hamburger {
  display: none;
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--surface2); border: 1px solid var(--border);
  align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer; flex-shrink: 0;
  transition: all .2s;
}
.hamburger:hover { background: var(--surface3); border-color: var(--border2); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,20,.65); backdrop-filter: blur(3px);
  z-index: 49;
}
.sidebar-overlay.open { display: block; }

/* ── Tablet (700–960px) ──────────────────────────────── */
@media (max-width: 960px) {
  :root { --sidebar-w: 220px; }
  .bot-pane { padding: .9rem; gap: .75rem; }
  .action-btn { min-width: 64px; padding: .6rem .7rem; }
}

/* ── Mobile (≤640px) — full responsive ──────────────── */
@media (max-width: 640px) {
  :root { --sidebar-w: 260px; }

  html, body { overflow: hidden; }

  /* Hamburger visible */
  .hamburger { display: flex; }

  /* Sidebar becomes slide-in drawer */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }

  /* Topbar */
  .topbar { padding: .6rem .9rem; height: 48px; gap: .55rem; }
  .topbar-title { font-size: .88rem; }
  .topbar-status { font-size: .72rem; }

  /* Bot pane */
  .bot-pane { padding: .65rem .6rem; gap: .65rem; overflow-y: auto; }

  /* Card */
  .card { padding: .8rem .9rem; }

  /* Server row stacks */
  .server-row { flex-direction: column; gap: .5rem; }
  .server-row .field,
  .server-row .field.host,
  .server-row .field.port { width: 100%; }
  .server-row .btns { width: 100%; }
  .server-row .btns .btn { flex: 1; }

  /* Actions grid — 4 per row */
  .actions-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .4rem;
  }
  .action-btn {
    min-width: unset; padding: .55rem .3rem;
    font-size: .68rem;
  }
  .action-btn .action-icon { font-size: 1.1rem; }

  /* Console */
  .console { font-size: .72rem; padding: .6rem .75rem; }
  .console-header { padding: .55rem .75rem; }

  /* Modal full-width on mobile */
  .modal {
    width: 96vw; max-width: 96vw;
    padding: 1.35rem 1.1rem;
    border-radius: var(--radius-lg);
  }

  /* ── Admin nav — 2 baris di mobile ──── */
  .admin-nav {
    height: auto; flex-wrap: wrap;
    padding: .55rem .9rem .45rem; gap: 0;
  }
  .admin-nav .brand { flex: 1; min-width: 0; }
  .admin-nav .nav-controls { order: 2; }
  .admin-nav .nav-pills {
    order: 3; width: 100%;
    display: flex; gap: .35rem;
    padding: .4rem 0 .15rem;
    border-top: 1px solid var(--border);
    margin-top: .4rem;
  }
  .nav-pill { padding: .3rem .65rem; font-size: .76rem; }
  .admin-body { padding: .75rem .6rem; }

  /* ── Section header ──────────────────── */
  .section-header { flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
  .section-header h2 { font-size: .95rem; }

  /* ── Fix overflow agar tabel bisa scroll ─ */
  .table-card { overflow: visible; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  td, th { padding: .5rem .65rem; font-size: .79rem; }

  /* ── Bots table: sembunyikan kolom Assigned & Proxy ── */
  /* Kolom: 1=Status 2=Name 3=Auth 4=Assigned 5=Proxy 6=Actions */
  #sec-bots th:nth-child(4), #sec-bots td:nth-child(4),
  #sec-bots th:nth-child(5), #sec-bots td:nth-child(5) { display: none; }

  /* ── Users table: sembunyikan kolom ID & Created ───── */
  /* Kolom: 1=ID 2=Username 3=Role 4=Created 5=Actions */
  #sec-users th:nth-child(1), #sec-users td:nth-child(1),
  #sec-users th:nth-child(4), #sec-users td:nth-child(4) { display: none; }

  /* Tombol aksi di tabel lebih compact */
  .btn-sm { padding: .35rem .6rem; font-size: .74rem; }
}
