:root {
  --bg: #0d0d0d;
  --sidebar-bg: #111111;
  --card-bg: #1a1a1a;
  --border: #2a2a2a;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --text: #e0e0e0;
  --text-muted: #888;
  --green: #2ecc71;
  --red: #e74c3c;
  --orange: #e67e22;
  --yellow: #f1c40f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { display: flex; min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'Segoe UI', sans-serif; font-size: 14px; }

/* SIDEBAR */
.sidebar { width: 220px; background: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 12px; gap: 6px; position: sticky; top: 0; height: 100vh; }
.logo { font-size: 18px; font-weight: 700; padding: 0 8px 20px; border-bottom: 1px solid var(--border); margin-bottom: 8px; letter-spacing: 1px; }
.nav-btn { width: 100%; text-align: left; padding: 10px 14px; border: none; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; transition: all .2s; }
.nav-btn:hover { background: var(--card-bg); color: var(--text); }
.nav-btn.active { background: var(--accent); color: #fff; }

/* CONTENT */
.content { flex: 1; padding: 32px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; }
h1 { font-size: 22px; margin-bottom: 24px; }
h3 { margin-bottom: 12px; font-size: 15px; }

/* TOOLBAR */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select, .toolbar input { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 13px; }
button { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer; font-size: 13px; transition: background .2s; }
button:hover { background: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; margin-top: 12px; width: 100%; padding: 12px; font-size: 14px; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .value { font-size: 32px; font-weight: 700; }
.stat-card .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* TABLE */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--card-bg); }
th { padding: 12px 14px; text-align: left; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.03); }

/* BADGES */
.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-open   { background: rgba(46,204,113,.15); color: var(--green); }
.badge-closed { background: rgba(231,76,60,.15);  color: var(--red); }
.badge-add    { background: rgba(46,204,113,.15); color: var(--green); }
.badge-remove { background: rgba(231,76,60,.15);  color: var(--red); }
.badge-ban    { background: rgba(231,76,60,.15);  color: var(--red); }
.badge-mute   { background: rgba(241,196,15,.15); color: var(--yellow); }
.badge-warn   { background: rgba(230,126,34,.15); color: var(--orange); }
.badge-info   { background: rgba(88,101,242,.15); color: var(--accent); }
.badge-error  { background: rgba(231,76,60,.15);  color: var(--red); }
.badge-active { background: rgba(46,204,113,.15); color: var(--green); }
.badge-done   { background: rgba(136,136,136,.15); color: var(--text-muted); }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.poll-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.poll-card h4 { font-size: 14px; margin-bottom: 12px; }
.poll-option { margin-bottom: 8px; }
.poll-option-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.poll-bar-bg { height: 6px; background: var(--border); border-radius: 3px; }
.poll-bar { height: 6px; background: var(--accent); border-radius: 3px; transition: width .5s; }

/* EMBED CREATOR */
.embed-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media(max-width:900px){ .embed-layout { grid-template-columns: 1fr; } }
.embed-form { display: flex; flex-direction: column; gap: 12px; }
.embed-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-muted); }
.embed-form input, .embed-form textarea, .embed-form select { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 13px; }
.embed-form textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.field-row input { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; }
.field-row button { padding: 6px 10px; border-radius: 6px; background: var(--red); color: #fff; border: none; cursor: pointer; font-size: 12px; }
.embed-preview-wrap { position: sticky; top: 32px; }
.embed-preview { background: #2f3136; border-left: 4px solid #0099ff; border-radius: 4px; padding: 16px; min-height: 100px; }
.embed-preview .ep-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.embed-preview .ep-desc { font-size: 13px; color: #b9bbbe; white-space: pre-wrap; margin-bottom: 10px; }
.embed-preview .ep-image img { max-width: 100%; border-radius: 4px; margin-top: 8px; }
.embed-preview .ep-footer { font-size: 11px; color: #72767d; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 8px; }
.embed-preview .ep-field { margin-bottom: 6px; }
.embed-preview .ep-field-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.embed-preview .ep-field-value { font-size: 12px; color: #b9bbbe; }
.embed-preview .ep-thumbnail img { float: right; width: 72px; height: 72px; border-radius: 4px; object-fit: cover; }
#embed-msg { margin-top: 8px; font-size: 13px; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .content { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px;
    gap: 8px;
  }
  .logo { padding-bottom: 12px; margin-bottom: 0; }
  .nav-btn { width: auto; display: inline-flex; }
  .content { padding: 20px 14px 28px; }
  .toolbar { gap: 8px; }
  .toolbar select, .toolbar input, button { width: 100%; }
  .btn-primary { width: 100%; }
  .embed-layout { grid-template-columns: 1fr; }
  .embed-preview-wrap { position: static; top: auto; }
}

@media (max-width: 640px) {
  body { font-size: 13px; }
  .sidebar { padding: 12px; }
  .nav-btn { width: 100%; }
  .content { padding: 16px 10px 24px; }
  h1 { font-size: 19px; margin-bottom: 18px; }
  h3 { font-size: 14px; }
  .stats-grid, .cards-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .stat-card .value { font-size: 26px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 760px; }
  th, td { padding: 10px 12px; font-size: 12px; }
  .poll-card { padding: 14px; }
  .poll-option-label { gap: 10px; flex-wrap: wrap; }
  .field-row { grid-template-columns: 1fr; }
  .field-row button { width: 100%; }
  .embed-form input, .embed-form textarea, .embed-form select { font-size: 16px; }
}

@media (max-width: 420px) {
  .logo { font-size: 16px; }
  .nav-btn { padding: 10px 12px; font-size: 12px; }
  .stat-card .value { font-size: 24px; }
  .badge { font-size: 10px; }
}
/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.pagination button {
  min-width: 110px;
  padding: 8px 14px;
}

.pagination span {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 6px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#logs-pagination,
#logs-pagination-bottom {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .pagination {
    gap: 8px;
  }

  .pagination button {
    min-width: 92px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .pagination span {
    width: 100%;
    text-align: center;
  }
}
