@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0b0f;
  --bg-card: #12141a;
  --bg-card-hover: #181b24;
  --bg-input: #1a1d27;
  --bg-sidebar: #0d0e13;
  --border: #1e2230;
  --border-focus: #4f6df5;
  --accent: #4f6df5;
  --accent-light: #6b86f7;
  --accent-glow: rgba(79, 109, 245, 0.15);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --orange: #f97316;
  --text: #e2e4ea;
  --text-dim: #8b90a0;
  --text-muted: #555a6e;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.2);
  --transition: 0.15s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* ═══ SIDEBAR ═══ */
.sidebar { width: 260px; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; transition: transform .25s; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent), #8b5cf6); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #fff; }
.brand-name { font-size: 16px; font-weight: 700; display: block; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text-muted); display: block; margin-top: 1px; }
.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); padding: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500; transition: all var(--transition); margin-bottom: 2px; }
.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent-light); }
.nav-item svg { flex-shrink: 0; opacity: .6; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; }
.user-name { font-size: 13px; font-weight: 600; }
.logout-btn { display: block; text-align: center; padding: 8px; border-radius: var(--radius-xs); background: var(--bg-input); color: var(--text-dim); text-decoration: none; font-size: 12px; font-weight: 500; transition: all var(--transition); }
.logout-btn:hover { background: var(--red); color: #fff; }

/* ═══ MAIN ═══ */
.main { flex: 1; margin-left: 260px; padding: 32px; min-height: 100vh; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ═══ CARDS ═══ */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ═══ GRID ═══ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .main { margin-left: 0; padding: 16px; } .sidebar { transform: translateX(-100%); } .sidebar.open { transform: translateX(0); } }

/* ═══ STATS ═══ */
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; transition: all var(--transition); }
.stat-card:hover { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ═══ BOT CARDS ═══ */
.bot-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: all .2s; cursor: pointer; position: relative; overflow: hidden; }
.bot-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.bot-card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.bot-avatar { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-input); object-fit: cover; }
.bot-name { font-size: 18px; font-weight: 700; }
.bot-guild { font-size: 13px; color: var(--text-dim); }
.bot-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.bot-status.online { background: rgba(34,197,94,.15); color: var(--green); }
.bot-status.offline { background: rgba(85,90,110,.15); color: var(--text-muted); }
.bot-status.error { background: rgba(239,68,68,.15); color: var(--red); }
.bot-status.starting { background: rgba(234,179,8,.15); color: var(--yellow); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.online .status-dot { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; font-family: inherit; transition: border var(--transition); outline: none; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--border-focus); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ═══ BUTTONS ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; border: none; transition: all var(--transition); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 0 20px var(--accent-glow); }
.btn-secondary { background: var(--bg-input); color: var(--text-dim); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.15); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(1.15); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

/* ═══ TOGGLE ═══ */
.toggle { width: 44px; height: 24px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; position: relative; transition: all var(--transition); }
.toggle.active { background: var(--accent); border-color: var(--accent); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--transition); }
.toggle.active::after { transform: translateX(20px); }

/* ═══ TABLE ═══ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg-card-hover); }

/* ═══ TAGS ═══ */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 16px; font-size: 12px; }
.tag .remove-tag { background: none; border: none; color: var(--red); cursor: pointer; font-size: 14px; padding: 0 2px; }

/* ═══ ADDON CARDS ═══ */
.addon-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.addon-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; cursor: pointer; transition: background var(--transition); }
.addon-header:hover { background: var(--bg-card-hover); }
.addon-info { display: flex; align-items: center; gap: 12px; }
.addon-label { font-size: 16px; font-weight: 700; }
.addon-desc { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.addon-status { display: flex; align-items: center; gap: 12px; }
.addon-body { padding: 0 24px 24px; display: none; border-top: 1px solid var(--border); }
.addon-body.open { display: block; padding-top: 20px; }
.chevron { transition: transform .2s; font-size: 18px; color: var(--text-muted); }
.chevron.open { transform: rotate(180deg); }

/* ═══ BADGES ═══ */
.badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(34,197,94,.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,.15); color: var(--red); }
.badge-yellow { background: rgba(234,179,8,.15); color: var(--yellow); }
.badge-blue { background: var(--accent-glow); color: var(--accent-light); }

/* ═══ TOAST ═══ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: #fff; background: var(--accent); box-shadow: var(--shadow); animation: toastIn .3s, toastOut .3s 2.7s forwards; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(40px); opacity: 0; } }

/* ═══ EMPTY STATE ═══ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ═══ LOGIN ═══ */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; width: 100%; }
.login-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 48px; text-align: center; max-width: 420px; width: 100%; }
.login-logo { font-size: 48px; margin-bottom: 16px; }
.login-title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--text-dim); margin-bottom: 32px; }
.btn-discord { background: #5865F2; color: #fff; padding: 14px 28px; font-size: 16px; font-weight: 700; border-radius: var(--radius-sm); width: 100%; }
.btn-discord:hover { background: #4752c4; }

/* ═══ NEW BOT ═══ */
.new-bot-container { max-width: 640px; margin: 0 auto; }
.steps { display: flex; gap: 12px; margin-bottom: 32px; }
.step { flex: 1; padding: 12px; text-align: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text-muted); }
.step.active { border-color: var(--accent); color: var(--accent-light); background: var(--accent-glow); }
.step.done { border-color: var(--green); color: var(--green); }

/* ═══ MOBILE ═══ */
.mobile-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 200; width: 40px; height: 40px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 20px; cursor: pointer; }
@media (max-width: 768px) { .mobile-toggle { display: flex; align-items: center; justify-content: center; } }

/* ═══ ACTIONS BAR ═══ */
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; }
