/* ==========================================================================
   XXPORN LOVERS — Admin Dashboard
   Same dark + pink brand system, professional rather than flashy.
   ========================================================================== */

body.admin { background: var(--bg-primary); }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(50% 50% at 50% 0%, rgba(255, 45, 117, 0.12) 0%, transparent 60%),
    var(--bg-primary);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
}
.auth-card .logo { display: flex; justify-content: center; margin-bottom: 8px; }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 14px;
}
.auth-head p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 6px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition-fast);
}
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--pink); }
.field-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; font-size: 0.82rem; }
.field-row a { color: var(--pink-soft); }
.field-row a:hover { color: var(--pink-hover); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }

.auth-card .btn { width: 100%; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 0.82rem; color: var(--text-muted); }

/* ---------- Dashboard shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-head {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.sidebar-nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(255,45,117,0.16), rgba(255,45,117,0.02));
  color: var(--text-primary);
  position: relative;
}
.sidebar-nav a.active::before {
  content: "";
  position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 3px;
  background: var(--gradient-brand);
}
.sidebar-nav a.active svg { opacity: 1; color: var(--pink-hover); }
.sidebar-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--pink);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-foot .who { min-width: 0; }
.sidebar-foot .who strong { display: block; font-size: 0.82rem; color: var(--text-primary); }
.sidebar-foot .who span { font-size: 0.72rem; color: var(--text-muted); }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(5,5,5,0.85);
  backdrop-filter: blur(14px);
  z-index: 10;
}
.admin-topbar h2 { font-size: 1.15rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mobile-only { display: none; }

.admin-content { padding: 28px; }

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color var(--transition-base);
}
.stat-card:hover { border-color: rgba(255,45,117,0.4); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .stat-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: rgba(255,45,117,0.12);
  color: var(--pink);
  display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-icon svg { width: 18px; height: 18px; }
.stat-card .delta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pink-soft);
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin-top: 14px;
  -webkit-text-fill-color: var(--text-primary);
  background: none;
  color: var(--text-primary);
}
.stat-card .stat-label { color: var(--text-secondary); text-transform: none; letter-spacing: 0; margin-top: 2px; }

/* ---------- Panel & table ---------- */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-head h3 { font-size: 1rem; font-weight: 700; }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.data-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-elevated); }
.row-media { display: flex; align-items: center; gap: 12px; }
.row-thumb {
  width: 64px; aspect-ratio: 16/9; border-radius: 6px;
  background: linear-gradient(135deg, #1a1a1a, #0c0c0c);
  border: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.row-thumb::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--pink);
}
.row-title { color: var(--text-primary); font-weight: 600; }
.row-title span { display: block; color: var(--text-muted); font-weight: 400; font-size: 0.76rem; margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-published { background: rgba(46, 204, 113, 0.12); color: #4ADE80; }
.badge-draft { background: rgba(167, 167, 167, 0.12); color: var(--text-secondary); }
.badge-pending { background: rgba(255, 45, 117, 0.14); color: var(--pink-soft); }
.badge-rejected { background: rgba(239, 68, 68, 0.12); color: #F87171; }

.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions button,
.row-actions a {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.row-actions button svg,
.row-actions a svg { width: 14px; height: 14px; }
.row-actions button:hover,
.row-actions a:hover { color: var(--pink); border-color: var(--pink); }
.row-actions button[disabled] { opacity: 0.4; cursor: not-allowed; }
.row-actions button[disabled]:hover { color: var(--text-secondary); border-color: var(--border); }

/* ---------- Mobile admin header + off-canvas sidebar ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    z-index: 200;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 190;
  }
  .sidebar-scrim.open { display: block; }
  .mobile-only { display: inline-flex; }
  .admin-content { padding: 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .admin-topbar { padding: 0 16px; }
  .panel-head { padding: 14px 16px; }
}
