/* =========================================================
   ELITE PVP — admin panel stylesheet
   Sidebar + content layout, scoped visually to match the
   public site's premium emerald HUD system.
   ========================================================= */

.admin-layout{
  max-width: 1440px; margin:0 auto; padding: 44px 32px 100px;
  display:grid; grid-template-columns: 264px 1fr; gap: 28px; align-items:start;
}
@media (max-width: 900px){ .admin-layout{ grid-template-columns: 1fr; } }

.admin-sidebar{
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; position: sticky; top: 90px;
}
.admin-panel-tag{
  display:flex; align-items:center; gap:8px; color: var(--red); font-weight:700; font-size:.7rem;
  text-transform:uppercase; letter-spacing:.12em; margin-bottom:8px; font-family: var(--font-mono);
}
.admin-brand{
  font-weight:800; font-size:1.3rem; margin-bottom: 20px; text-transform:uppercase;
  padding-bottom:18px; border-bottom:1px solid var(--border-soft);
}
.admin-nav{ display:flex; flex-direction:column; gap:3px; }
.admin-nav a{
  display:flex; align-items:center; gap:11px; padding: 11px 14px; border-radius:8px;
  color: var(--muted); font-weight:600; font-size:.88rem; transition:.15s var(--ease);
  border:1px solid transparent; position:relative;
}
.admin-nav a:hover{ background: rgba(255,255,255,.04); color: var(--text); }
.admin-nav a.active{
  background: rgba(23,217,76,.1); color: var(--text);
  border-color: rgba(23,217,76,.3);
}
.admin-nav a.active::before{
  content:""; position:absolute; left:-1px; top:8px; bottom:8px; width:3px;
  background: var(--gradient); border-radius:2px;
}

.admin-content > .admin-page-title{
  font-size:1.8rem; font-weight:800; display:flex; align-items:center; gap:12px; margin-bottom:8px;
  text-transform:uppercase;
}
.admin-page-sub{ color: var(--muted); margin-bottom: 28px; }

.admin-card{
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; margin-bottom: 24px; position:relative;
  /* NOTE: intentionally no overflow:hidden here — this card holds the
     rank dropdown (and other absolutely-positioned popovers), and
     clipping overflow was cutting their menus off partway through
     the list. The gradient accent bar below gets its own rounded
     corners instead, so we don't need overflow:hidden to fake it. */
}
.admin-card::before{
  content:""; position:absolute; top:0; left:0; right:0; height:2px;
  background: var(--gradient); opacity:.85;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.admin-card h3{ margin:0 0 4px; font-size:1.18rem; font-weight:700; font-family: var(--font-display); text-transform:uppercase; }
.admin-card .hint{ color: var(--muted); font-size:.85rem; margin-bottom: 22px; }

.stat-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:18px; }
@media (max-width:900px){ .stat-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width:560px){ .stat-grid{ grid-template-columns: 1fr; } }
.stat-card{
  background: linear-gradient(180deg, var(--panel), var(--bg-soft)); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; display:flex; flex-direction:column; gap:16px; transition:.18s var(--ease);
}
.stat-card:hover{ border-color: rgba(23,217,76,.5); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.stat-card-top{ display:flex; align-items:center; justify-content:space-between; }
.stat-icon{
  width:40px; height:40px; border-radius:10px; background: rgba(23,217,76,.12); color: var(--red);
  display:flex; align-items:center; justify-content:center; font-size:1.1rem;
  border: 1px solid rgba(23,217,76,.25);
}
.stat-manage{ color: var(--muted); font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.stat-num{ font-family: var(--font-mono); font-size:2.2rem; font-weight:700; font-variant-numeric: tabular-nums; }
.stat-label{ color: var(--muted); font-size:.76rem; text-transform:uppercase; letter-spacing:.08em; }
.stat-desc{ color: var(--muted-2); font-size:.8rem; margin-top:-10px; }

.admin-table{ width:100%; border-collapse: collapse; }
.admin-table th{
  text-align:left; padding: 11px 14px; color: var(--muted); font-size:.68rem; text-transform:uppercase;
  letter-spacing:.1em; border-bottom:1px solid var(--border); font-family: var(--font-mono);
}
.admin-table td{ padding: 15px 14px; border-bottom:1px solid var(--border-soft); font-size:.88rem; vertical-align:middle; }
.admin-table tr:last-child td{ border-bottom:none; }
.admin-table tr:hover td{ background: rgba(255,255,255,.015); }
.admin-table .row-empty td{ text-align:center; color: var(--muted); padding: 44px 14px; }

.item-row-actions{ display:flex; gap:8px; }
.icon-btn{
  width:32px; height:32px; border-radius:8px; border:1px solid var(--border); background: var(--bg-soft);
  color: var(--text); display:flex; align-items:center; justify-content:center; font-size:.9rem;
  transition:.15s var(--ease);
}
.icon-btn:hover{ border-color: var(--red); color: var(--red); background: rgba(23,217,76,.08); }
.icon-btn.danger:hover{ border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,.14); }

.list-item{
  background: var(--panel); border:1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; transition:.15s var(--ease);
}
.list-item:hover{ border-color: rgba(23,217,76,.3); }
.list-item-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.list-item-head .badges{ display:flex; gap:8px; align-items:center; }

.q-editor{
  background: var(--bg-soft); border:1px solid var(--border); border-radius: var(--radius); padding: 16px;
  margin-bottom: 14px;
}
.q-editor-top{ display:flex; gap:10px; align-items:center; margin-bottom:10px; }
.q-editor-top input[type="text"]{
  flex:1; background: var(--panel); border:1px solid var(--border); border-radius:8px; padding:10px 12px; color:var(--text);
}
.q-editor-top input[type="text"]:focus{ outline:none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(23,217,76,.14); }
.q-order-btns{ display:flex; flex-direction:column; gap:2px; }
.q-order-btns button{ background:none; border:none; color: var(--muted); font-size:.9rem; }
.q-order-btns button:hover{ color: var(--red); }
.q-editor-meta{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; font-size:.82rem; color:var(--muted); }
.q-editor-meta select{ background: var(--panel); border:1px solid var(--border); border-radius:6px; padding:6px 10px; color: var(--text); }
.q-editor-meta input[type="text"].id-input{ width:150px; background: var(--panel); border:1px solid var(--border); border-radius:6px; padding:6px 10px; color: var(--text); font-family: var(--font-mono); }

.rank-select-row{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.rank-select-row input{ flex:1; min-width:220px; }
.rank-dropdown{ position:relative; }
.rank-dropdown-btn{
  background: var(--bg-soft); border:1px solid var(--border); border-radius:8px; padding:12px 16px; color: var(--text);
  min-width:170px; text-align:left; display:flex; justify-content:space-between; align-items:center; gap:10px;
  transition:.15s var(--ease);
}
.rank-dropdown-btn:hover{ border-color: rgba(23,217,76,.5); }
.rank-dropdown-menu{
  position:absolute; top: 48px; left:0; right:0; background: var(--panel-2); border:1px solid var(--border);
  border-radius: 8px; overflow:hidden; z-index: 20; display:none; max-height: 280px; overflow-y:auto;
  box-shadow: var(--shadow-card);
}
.rank-dropdown-menu.open{ display:block; animation: dropIn .16s var(--ease); }
.rank-dropdown-menu button{
  width:100%; text-align:left; background:none; border:none; padding:10px 16px; color: var(--text); font-weight:600;
}
.rank-dropdown-menu button:hover{ background: rgba(23,217,76,.1); color: var(--red); }

.rank-pill{
  display:inline-flex; padding:4px 12px; border-radius:999px; font-weight:800; font-size:.7rem;
  text-transform:uppercase; letter-spacing:.05em; border:1px solid currentColor; font-family: var(--font-mono);
}

.toggle-row{ display:flex; gap:10px; }
.toggle-btn{
  padding: 10px 26px; border-radius:8px; border:1px solid var(--border); background: var(--bg-soft);
  color: var(--muted); font-weight:700; text-transform:uppercase; font-size:.82rem; letter-spacing:.03em;
  transition:.15s var(--ease);
}
.toggle-btn.on{ border-color: var(--green); color: var(--green); background: rgba(43,224,138,.08); }
.toggle-btn.off.active{ border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,.08); }

.user-cell{ display:flex; align-items:center; gap:10px; }
.user-cell img{ width:28px; height:28px; border-radius:50%; border:1px solid var(--border-soft); }

.admin-denied{ text-align:center; padding: 110px 20px; }

/* =========================================================
   Modal (Team / Creator add-edit dialogs)
   ========================================================= */
#modalRoot:empty{ display:none; }
.modal-overlay{
  position:fixed; inset:0; z-index:200; background: rgba(4,6,10,.72); backdrop-filter: blur(4px);
  display:flex; align-items:flex-start; justify-content:center; padding: 60px 20px; overflow-y:auto;
  animation: fadeIn .15s var(--ease);
}
@keyframes fadeIn{ from{ opacity:0; } to{ opacity:1; } }
.modal-panel{
  width:100%; max-width: 640px; background: linear-gradient(180deg, var(--panel-2), var(--bg-soft));
  border:1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: modalIn .18s var(--ease);
}
@keyframes modalIn{ from{ transform: translateY(14px); opacity:0; } to{ transform:none; opacity:1; } }
.modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding: 20px 24px; border-bottom:1px solid var(--border-soft);
}
.modal-title{ font-weight:800; font-size:1.15rem; text-transform:uppercase; letter-spacing:.02em; font-family: var(--font-display); }
.modal-body{ padding: 24px; max-height: 74vh; overflow-y:auto; }
.modal-body .field-row{ margin-bottom:0; }
.modal-body .field{ margin-bottom:18px; }

/* ---------- Avatar upload row (shared by Team + Creator modals) --- */
.avatar-upload-row{
  display:flex; align-items:center; gap:18px; margin-bottom:22px; padding-bottom:22px;
  border-bottom:1px solid var(--border-soft);
}
.avatar-preview, .avatar-placeholder{
  width:76px; height:76px; border-radius:14px; object-fit:cover; flex-shrink:0;
  background: var(--bg-soft); border:1px solid var(--border);
}
.avatar-placeholder{ display:flex; align-items:center; justify-content:center; color: var(--muted); font-size:1.4rem; }
.file-btn{ display:inline-flex; align-items:center; gap:8px; cursor:pointer; }

/* ---------- Drag-to-reorder rows (Team list) ---------- */
.drag-row{ display:flex; align-items:center; gap:14px; cursor:grab; }
.drag-row.dragging{ opacity:.4; }
.drag-row-avatar{ width:44px; height:44px; border-radius:10px; object-fit:cover; border:1px solid var(--border-soft); flex-shrink:0; }
.drag-row-info{ flex:1; min-width:0; }
.drag-handle{ color: var(--muted); flex-shrink:0; cursor:grab; }
.drag-handle:active{ cursor:grabbing; }

/* ---------- Creator Manager toolbar ---------- */
.creator-toolbar{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.creator-toolbar input{
  flex:1; min-width:200px; background: var(--bg-soft); border:1px solid var(--border); border-radius:8px;
  padding:10px 14px; color: var(--text);
}
.creator-toolbar input:focus{ outline:none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(23,217,76,.14); }
.filter-pills{ display:flex; gap:6px; background: var(--bg-soft); border:1px solid var(--border); border-radius:999px; padding:4px; }
.filter-pill{
  border:none; background:none; color: var(--muted); font-weight:700; font-size:.78rem; text-transform:uppercase;
  letter-spacing:.03em; padding:7px 16px; border-radius:999px; transition:.15s var(--ease);
}
.filter-pill.active{ background: var(--gradient); color:#04140a; }
.filter-pill:not(.active):hover{ color: var(--text); }

/* ---------- Creator Manager cards ---------- */
/* =========================================================
   Web Permissions system (Admins & Ranks page)
   ========================================================= */
.perm-grid{ display:flex; flex-direction:column; gap:14px; }
.perm-grid-rest{ display:grid; grid-template-columns: repeat(2,1fr); gap:12px; }
@media (max-width: 760px){ .perm-grid-rest{ grid-template-columns: 1fr; } }

.perm-card{
  display:flex; align-items:flex-start; gap:12px; cursor:pointer; user-select:none;
  background: var(--bg-soft); border:1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; transition:.15s var(--ease); position:relative;
}
.perm-card input[type="checkbox"]{
  margin-top:3px; width:16px; height:16px; accent-color: var(--red); flex-shrink:0; cursor:pointer;
}
.perm-card:hover{ border-color: rgba(23,217,76,.4); }
.perm-card.checked{ border-color: var(--red); background: rgba(23,217,76,.08); box-shadow: 0 0 0 1px rgba(23,217,76,.25) inset; }
.perm-card.disabled{ opacity:.4; cursor:not-allowed; }
.perm-card.disabled input{ cursor:not-allowed; }
.perm-card-icon{
  width:34px; height:34px; border-radius:9px; background: rgba(23,217,76,.12); color: var(--red);
  display:flex; align-items:center; justify-content:center; font-size:1rem; flex-shrink:0;
  border:1px solid rgba(23,217,76,.25);
}
.perm-card-text{ min-width:0; }
.perm-card-title{ font-weight:700; font-size:.9rem; }
.perm-card-desc{ color: var(--muted); font-size:.78rem; margin-top:2px; line-height:1.4; }
.perm-card-all{
  border-color: rgba(234,179,8,.4); background: linear-gradient(180deg, rgba(234,179,8,.08), transparent);
}
.perm-card-all .perm-card-icon{ background: rgba(234,179,8,.14); color: var(--yellow); border-color: rgba(234,179,8,.3); }
.perm-card-all.checked{ border-color: var(--yellow); box-shadow: 0 0 0 1px rgba(234,179,8,.3) inset; background: rgba(234,179,8,.1); }

.perm-chip-row{ display:flex; flex-wrap:wrap; gap:6px; max-width:320px; }
.perm-chip{
  display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:999px;
  background: var(--bg-soft); border:1px solid var(--border); color: var(--text); font-size:.7rem;
  font-weight:700; text-transform:uppercase; letter-spacing:.03em;
}
.perm-chip-all{ border-color: rgba(234,179,8,.5); color: var(--yellow); background: rgba(234,179,8,.1); }
.perm-chip-none{ color: var(--muted-2); border-style:dashed; text-transform:none; font-weight:600; letter-spacing:0; }

.rank-dot{ display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:9px; flex-shrink:0; }

/* ---------- Rank Colors editor ---------- */
.rank-color-grid{ display:flex; flex-direction:column; gap:10px; }
.rank-color-row{
  display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  background: var(--bg-soft); border:1px solid var(--border); border-radius: var(--radius); padding: 12px 16px;
}
.rank-color-inputs{ display:flex; align-items:center; gap:10px; }
.rank-color-inputs input[type="color"]{
  width:38px; height:34px; border-radius:8px; border:1px solid var(--border); background:none; padding:2px; cursor:pointer;
}
.rank-color-hex{
  width:100px; background: var(--panel); border:1px solid var(--border); border-radius:8px; padding:8px 10px;
  color: var(--text); font-family: var(--font-mono); text-transform:uppercase; font-size:.82rem;
}
.rank-color-hex:focus{ outline:none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(23,217,76,.14); }

.creator-admin-card{
  display:flex; align-items:center; gap:14px; background: var(--panel); border:1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom:10px; cursor:grab;
}
.creator-admin-card.dragging{ opacity:.4; }
.creator-admin-card img{ width:48px; height:48px; border-radius:10px; object-fit:cover; border:1px solid var(--border-soft); flex-shrink:0; }
.creator-admin-info{ flex:1; min-width:0; }
.creator-admin-info a{ color: var(--muted); text-decoration: underline; }
.creator-admin-info a:hover{ color: var(--text); }

/* =========================================================
   Shop manager: tabs, image dropzone, categories
   ========================================================= */
.shop-tabs{ display:flex; gap:8px; margin-bottom:22px; border-bottom:1px solid var(--border-soft); }
.shop-tab{
  background:none; border:none; color: var(--muted); font:inherit; font-weight:700; font-size:.88rem;
  text-transform:uppercase; letter-spacing:.06em; padding: 12px 18px; cursor:pointer;
  border-bottom:2px solid transparent; margin-bottom:-1px; transition:.15s var(--ease);
}
.shop-tab:hover{ color: var(--text); }
.shop-tab.active{ color: var(--text); border-bottom-color: var(--green, #17d94c); }
.shop-tab .count{
  display:inline-block; min-width:22px; padding:1px 7px; margin-left:6px; border-radius:99px;
  background: rgba(255,255,255,.07); font-size:.72rem; text-align:center;
}

.img-field [hidden]{ display:none !important; }
.img-drop{
  position:relative; display:flex; align-items:center; justify-content:center; text-align:center;
  min-height:170px; border:2px dashed var(--border); border-radius: var(--radius-lg, 14px);
  background: var(--bg-soft); cursor:pointer; overflow:hidden; transition:.18s var(--ease);
}
.img-drop:hover, .img-drop:focus-visible{ border-color: rgba(23,217,76,.5); background: rgba(23,217,76,.04); outline:none; }
.img-drop.dragover{ border-color:#17d94c; background: rgba(23,217,76,.1); transform: scale(1.005); }
.img-drop.uploading{ pointer-events:none; opacity:.85; }
.img-preview{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.img-hint{
  position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:22px; color: var(--muted); font-size:.85rem;
}
.img-hint strong{ color: var(--text); font-size:.95rem; }
.img-hint small{ color: var(--muted-2, #5c6864); font-size:.74rem; margin-top:4px; }
.img-hint-icon{ font-size:1.8rem; color:#17d94c; line-height:1; margin-bottom:4px; }
/* When an image is showing, the hint becomes a hover overlay. */
.img-drop.has-image .img-hint{
  position:absolute; inset:0; justify-content:center; background: rgba(8,12,10,.72);
  opacity:0; transition:.18s var(--ease);
}
.img-drop.has-image:hover .img-hint, .img-drop.has-image.dragover .img-hint, .img-drop.has-image:focus-visible .img-hint{ opacity:1; }
.img-progress{ position:absolute; left:0; right:0; bottom:0; height:5px; background: rgba(255,255,255,.1); z-index:2; }
.img-progress > div{ height:100%; width:0; background: linear-gradient(90deg,#17d94c,#7dffa0); transition:width .12s linear; }
.img-link-row{ display:flex; gap:10px; margin-top:10px; align-items:center; }
.img-link-row input{ flex:1; min-width:0; }
.img-status{ min-height:18px; margin-top:8px; font-size:.8rem; color: var(--muted); }
.img-status.error{ color: var(--danger, #ef4444); }

.shop-thumb{
  width:46px; height:46px; border-radius:9px; object-fit:cover; display:block;
  border:1px solid var(--border-soft); background: var(--bg-soft);
}
.shop-thumb.empty{ display:flex; align-items:center; justify-content:center; color: var(--muted); }
.shop-table-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.shop-filter-select{
  background: var(--bg-soft); color: var(--text); border:1px solid var(--border);
  border-radius:8px; padding:9px 12px; font:inherit; font-size:.85rem;
}

.cat-add-row{ display:flex; gap:12px; flex-wrap:wrap; }
.cat-add-row input{ flex:1; min-width:220px; }
.cat-list{ display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.cat-row{
  padding:12px 16px; background: var(--bg-soft); border:1px solid var(--border-soft);
  border-radius:10px; transition:.15s var(--ease);
}
.cat-row:hover{ border-color: rgba(23,217,76,.35); }
.cat-row .badge{ margin-left:auto; }
.cat-add-row input{
  background: var(--bg-soft); border:1px solid var(--border); border-radius:8px;
  padding: 12px 14px; color: var(--text); font-size:.92rem; outline:none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.cat-add-row input:focus{ border-color: var(--red); box-shadow: 0 0 0 3px rgba(23,217,76,.14); }
