/* Reinado RPG — Painel Admin */
:root {
  --rrpg-primary: #7c3aed;
  --rrpg-accent:  #a855f7;
  --rrpg-text:    #ece4ff;
  --rrpg-bg-1:    #0c0a1a;
  --rrpg-bg-2:    #1a0f2e;
  --rrpg-card:    #15102a;
  --rrpg-border:  rgba(168,85,247,.35);
}

* { box-sizing: border-box; }

body.admin-body {
  margin: 0;
  background: linear-gradient(180deg, var(--rrpg-bg-1) 0%, var(--rrpg-bg-2) 100%);
  color: var(--rrpg-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

/* Topbar */
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px;
  background: rgba(12,10,26,.85);
  border-bottom: 1px solid var(--rrpg-border);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-logo { width: 32px; height: 32px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(124,58,237,.15);
  border: 1px solid var(--rrpg-border);
  border-radius: 999px; padding: 4px 12px;
}
.user-pic, .user-pic-fallback {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: rgba(168,85,247,.25); display: flex; align-items: center; justify-content: center;
}
.user-info { display: flex; flex-direction: column; line-height: 1.1; }
.user-info strong { font-size: 13px; }
.user-role {
  font-size: 10px; text-transform: uppercase; letter-spacing: .15em;
  color: #c084fc;
}
.user-role.role-admin     { color: #fde68a; }
.user-role.role-moderator { color: #c4b5fd; }

.btn-ghost {
  background: transparent; border: 1px solid var(--rrpg-border); color: var(--rrpg-text);
}
.btn-ghost:hover { background: rgba(168,85,247,.18); color: #fff; }

/* Main */
.admin-main { max-width: 1100px; margin: 28px auto; padding: 0 22px; }

/* Tabs */
.admin-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px; border-radius: 14px;
  background: rgba(26,15,46,.65); border: 1px solid var(--rrpg-border);
  margin-bottom: 22px;
}
.tab-btn {
  flex: 1 1 auto;
  background: transparent; color: var(--rrpg-text);
  border: 0; border-radius: 10px; padding: 10px 14px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.tab-btn:hover { background: rgba(168,85,247,.15); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--rrpg-primary), var(--rrpg-accent));
  color: #fff;
  box-shadow: 0 0 18px rgba(168,85,247,.55);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Headings */
h2 {
  font-size: 22px; font-weight: 800; margin: 0 0 18px;
  display: flex; align-items: center; gap: 10px;
}
h2 i { color: var(--rrpg-accent); }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 14px; color: #d8b4fe; }
h4 { font-size: 14px; font-weight: 700; margin: 0 0 10px; color: #c4b5fd; }
.hint { font-size: 13px; color: rgba(236,228,255,.7); margin: 4px 0 14px; }
code { background: rgba(0,0,0,.4); padding: 2px 6px; border-radius: 4px; color: #fde68a; }

/* Card */
.card-rpg {
  background: var(--rrpg-card);
  border: 1px solid var(--rrpg-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 0 0 1px rgba(168,85,247,.1) inset;
}

/* Inputs */
label {
  display: block; font-size: 13px; font-weight: 600;
  color: #d8b4fe; margin: 12px 0 6px; letter-spacing: .02em;
}
input[type="text"], input[type="email"], input[type="number"],
input[type="date"], input[type="password"], textarea, select {
  width: 100%;
  background: rgba(12,10,26,.6);
  border: 1px solid var(--rrpg-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--rrpg-text);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--rrpg-accent);
  box-shadow: 0 0 0 3px rgba(168,85,247,.25);
}
input[type="range"] { width: 100%; accent-color: var(--rrpg-accent); }

/* Buttons */
.btn-primary-rpg {
  background: linear-gradient(135deg, var(--rrpg-primary), var(--rrpg-accent));
  border: 0; border-radius: 10px; color: #fff; font-weight: 700;
  padding: 10px 18px; cursor: pointer; font-size: 14px;
  transition: filter .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 0 18px rgba(168,85,247,.45);
}
.btn-primary-rpg:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary-rpg:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary-rpg {
  background: rgba(124,58,237,.18);
  border: 1px solid var(--rrpg-border);
  border-radius: 8px; color: var(--rrpg-text);
  padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-secondary-rpg:hover { background: rgba(124,58,237,.4); color: #fff; }

.btn-danger-rpg {
  background: rgba(239,68,68,.2);
  border: 1px solid rgba(239,68,68,.5);
  border-radius: 8px; color: #fca5a5;
  padding: 6px 12px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.btn-danger-rpg:hover { background: rgba(239,68,68,.4); color: #fff; }

.form-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 10px; }

/* Radio row */
.radio-row { display: flex; flex-wrap: wrap; gap: 16px; }
.radio-row label { font-weight: 500; color: var(--rrpg-text); display: flex; align-items: center; gap: 6px; }

/* MC status preview */
.mc-status {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px;
  background: rgba(0,0,0,.3); border: 1px dashed var(--rrpg-border);
  font-size: 13px; line-height: 1.6;
}
.mc-online  { color: #4ade80; }
.mc-offline { color: #fca5a5; }

/* Visual tab */
.visual-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 980px) { .visual-grid { grid-template-columns: 1.2fr 1fr; } }

.image-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.thumb {
  width: 80px; height: 80px; object-fit: contain;
  border-radius: 10px; border: 1px solid var(--rrpg-border);
  background: rgba(0,0,0,.4); padding: 6px;
}
.thumb-sm { width: 48px; height: 48px; }
.thumb-wide { width: 120px; height: 70px; object-fit: cover; }
.image-actions { flex: 1; min-width: 0; }
.image-actions input { margin-bottom: 6px; }

.color-row {
  display: grid; grid-template-columns: 80px 60px 1fr;
  gap: 10px; align-items: center; margin-bottom: 10px;
}
.color-row label { margin: 0; }
.color-row input[type="color"] {
  width: 60px; height: 36px; padding: 0; border-radius: 8px;
  border: 1px solid var(--rrpg-border); background: transparent; cursor: pointer;
}

.theme-preview {
  margin-top: 8px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--rrpg-border);
}
.tp-bg {
  padding: 22px; min-height: 180px;
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.tp-bg img { height: 50px; margin-bottom: 10px; }
#tpTitle { font-weight: 800; margin: 4px 0; }
#tpText  { font-size: 13px; opacity: .9; margin: 0 0 12px; }
#tpBtn {
  background: var(--rrpg-primary); color: #fff; border: 0;
  padding: 8px 16px; border-radius: 8px; font-weight: 600;
}

/* Lists */
.list-rpg { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(0,0,0,.25); border: 1px solid var(--rrpg-border);
}
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.list-item .li-meta  { font-size: 12px; opacity: .75; margin-bottom: 4px; }
.list-item .li-text  { font-size: 13px; line-height: 1.5; margin: 0; word-break: break-word; }
.list-item .li-actions { display: flex; gap: 6px; flex-shrink: 0; }

.badge-prio {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
}
.badge-prio.normal    { background: rgba(168,85,247,.22); color: #c4b5fd; }
.badge-prio.important { background: rgba(245,158,11,.22); color: #fbbf24; }
.badge-prio.urgent    { background: rgba(239,68,68,.25);  color: #fca5a5; }
.badge-off { background: rgba(100,116,139,.3); color: #cbd5e1; font-size: 10px; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }

/* Toast */
.admin-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--rrpg-card); border: 1px solid var(--rrpg-border);
  padding: 12px 18px; border-radius: 10px;
  color: var(--rrpg-text); font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
}
.admin-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.admin-toast.error { border-color: rgba(239,68,68,.6); color: #fca5a5; }
.admin-toast.success { border-color: rgba(34,197,94,.5); color: #86efac; }
