/* ============================================================
   NES EMU Admin Panel — Stylesheet
   Palette: Red #E60012 | White | Light Grey sidebar
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --red:         #E60012;
  --red-hover:   #C4000F;
  --red-light:   #FFF0F1;
  --red-mid:     #FFD6D9;
  --white:       #FFFFFF;
  --sidebar-bg:  #1A1A1A;
  --sidebar-hover: #2A2A2A;
  --sidebar-active: #E60012;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-active: #FFFFFF;
  --body-bg:     #F4F5F7;
  --card-bg:     #FFFFFF;
  --border:      #E2E2E2;
  --border-mid:  #CFCFCF;
  --text:        #1A1A1A;
  --text-muted:  #6B6B6B;
  --text-light:  #9B9B9B;
  --success:     #1B7A3E;
  --success-bg:  #E8FFF0;
  --success-border: #B6EAC8;
  --warning:     #92600A;
  --warning-bg:  #FFF8E6;
  --warning-border: #F5D98B;
  --danger:      #C4000F;
  --danger-bg:   #FFF0F1;
  --danger-border: #FFD6D9;
  --info-bg:     #E8F4FF;
  --info-border: #B6D8F5;
  --info-text:   #0E5EA8;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.10);
  --transition:  0.15s ease;
  --sidebar-w:   240px;
  --topbar-h:    60px;
  --font:        'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-hover); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── LAYOUT ── */
.admin-layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo-badge {
  background: var(--red);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}
.sidebar-brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
}

/* Nav sections */
.sidebar-section {
  padding: 20px 0 8px;
  flex: 1;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0 20px 8px;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  border-radius: 0;
}
.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-nav-item.active {
  background: var(--red);
  color: #fff;
}
.sidebar-nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}
.sidebar-nav-item.active svg,
.sidebar-nav-item:hover svg { opacity: 1; }
.sidebar-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.sidebar-nav-item.active .sidebar-badge {
  background: rgba(255,255,255,0.25);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-footer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-footer-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-footer-role { font-size: 11px; color: rgba(255,255,255,0.4); }
.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(230,0,18,0.2); color: #fff; border-color: var(--red); }
.btn-logout svg { width: 14px; height: 14px; }

/* ── MAIN ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.topbar-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-breadcrumb a { color: var(--text-muted); }
.topbar-breadcrumb a:hover { color: var(--red); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-view-site {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.topbar-view-site:hover { border-color: var(--red); color: var(--red); }
.topbar-view-site svg { width: 14px; height: 14px; }

/* ── PAGE BODY ── */
.admin-body {
  padding: 28px;
  flex: 1;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header-left h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.page-header-left p {
  font-size: 13px;
  color: var(--text-muted);
}
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ── STAT CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.red     { background: var(--red-light); color: var(--red); }
.stat-icon.green   { background: var(--success-bg); color: var(--success); }
.stat-icon.blue    { background: var(--info-bg); color: var(--info-text); }
.stat-icon.orange  { background: var(--warning-bg); color: var(--warning); }
.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-change {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── CARDS ── */
.admin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.admin-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.admin-card-body { padding: 20px; }
.admin-card-body.no-pad { padding: 0; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary  { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-hover); border-color: var(--red-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--red); color: var(--red); }
.btn-success  { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { font-size: 12px; padding: 6px 12px; }
.btn-xs { font-size: 11px; padding: 4px 9px; border-radius: var(--radius-sm); }
.btn-icon { padding: 8px; border-radius: var(--radius-md); background: transparent; border: 1.5px solid var(--border); color: var(--text-muted); }
.btn-icon:hover { border-color: var(--red); color: var(--red); }
.btn-icon svg { width: 16px; height: 16px; }

/* ── TABLES ── */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table thead {
  background: var(--body-bg);
  border-bottom: 1.5px solid var(--border);
}
.admin-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}
.admin-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background var(--transition); }
.admin-table tbody tr:hover { background: #FAFAFA; }
.admin-table .col-thumb { width: 52px; }
.admin-table .col-actions { width: 120px; text-align: right; }
.table-thumb {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--body-bg);
}
.table-title { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.table-sub   { font-size: 12px; color: var(--text-muted); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
  white-space: nowrap;
}
.badge-red       { background: var(--red); color: #fff; }
.badge-success   { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning   { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger    { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-grey      { background: var(--body-bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-blue      { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }
.badge-published { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-draft     { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-archived  { background: var(--body-bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-label .required { color: var(--red); margin-left: 3px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,0,18,0.08);
}
.form-control::placeholder { color: var(--text-light); }
.form-control[type="file"] { padding: 8px; cursor: pointer; }
.form-control-textarea {
  resize: vertical;
  min-height: 100px;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--red);
  cursor: pointer;
}
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.input-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}
.input-group:focus-within { border-color: var(--red); }
.input-group-prefix {
  padding: 9px 12px;
  background: var(--body-bg);
  color: var(--text-muted);
  font-size: 13px;
  border-right: 1.5px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}
.input-group .form-control {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ── EDITOR TOOLBAR (TinyMCE placeholder) ── */
.editor-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}
.editor-wrap:focus-within { border-color: var(--red); }
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: var(--body-bg);
  border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap;
}
.editor-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.editor-btn:hover { background: var(--border); color: var(--text); }
.editor-btn.active { background: var(--red-light); color: var(--red); }
.editor-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.editor-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
}
.editor-area {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  resize: vertical;
  background: var(--white);
}

/* ── IMAGE UPLOAD ── */
.upload-zone {
  border: 2px dashed var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--body-bg);
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--red);
  background: var(--red-light);
}
.upload-zone svg { width: 36px; height: 36px; color: var(--text-light); margin: 0 auto 10px; }
.upload-zone-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-zone-sub   { font-size: 12px; color: var(--text-muted); }
.upload-zone input[type="file"] { display: none; }
.upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 12px;
}
.upload-preview img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.upload-preview-info { flex: 1; }
.upload-preview-name { font-size: 13px; font-weight: 600; color: var(--text); }
.upload-preview-size { font-size: 11px; color: var(--text-muted); }
.upload-preview-remove {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

/* ── SCREENSHOTS MANAGER ── */
.screenshots-manager {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.screenshot-thumb {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--border);
  aspect-ratio: 16/10;
  background: var(--body-bg);
}
.screenshot-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.screenshot-thumb-remove {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: rgba(230,0,18,0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition);
}
.screenshot-thumb:hover .screenshot-thumb-remove { opacity: 1; }
.screenshot-add {
  border: 2px dashed var(--border-mid);
  border-radius: var(--radius-md);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--body-bg);
}
.screenshot-add:hover { border-color: var(--red); background: var(--red-light); }
.screenshot-add svg { width: 20px; height: 20px; color: var(--text-light); }
.screenshot-add span { font-size: 11px; color: var(--text-muted); }

/* ── FILTERS / SEARCH ── */
.table-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  flex: 1;
  max-width: 280px;
  transition: border-color var(--transition);
}
.table-search:focus-within { border-color: var(--red); }
.table-search svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.table-search input {
  border: none; background: none; outline: none;
  font-size: 13.5px; color: var(--text); width: 100%;
}
.table-search input::placeholder { color: var(--text-light); }
.table-filter-select {
  padding: 7px 28px 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.table-filter-select:focus { border-color: var(--red); }
.table-count { font-size: 13px; color: var(--text-muted); margin-left: auto; }

/* ── PAGINATION ── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.admin-pagination-pages { display: flex; gap: 4px; }
.pg-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.pg-btn:hover { border-color: var(--red); color: var(--red); }
.pg-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.pg-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ── ALERTS ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.alert-danger   { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-border); }
.alert-warning  { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.alert-info     { background: var(--info-bg);    color: var(--info-text); border-color: var(--info-border); }

/* ── TABS ── */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.admin-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--red); border-bottom-color: var(--red); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── TOGGLE SWITCH ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-mid);
  border-radius: 11px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--red); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── FORM ACTIONS (sticky bottom bar) ── */
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--white);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 50;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}
.form-actions-right { margin-left: auto; display: flex; gap: 10px; }

/* ── SEO PREVIEW ── */
.seo-preview {
  background: var(--body-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.seo-preview-url   { font-size: 13px; color: #1a6d00; margin-bottom: 3px; }
.seo-preview-title { font-size: 17px; color: #1a0dab; margin-bottom: 3px; font-weight: 400; }
.seo-preview-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.seo-char-count    { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 4px; }
.seo-char-count.warn  { color: var(--warning); }
.seo-char-count.over  { color: var(--danger); }

/* ── MEDIA LIBRARY GRID ── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.media-item {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: var(--body-bg);
  transition: border-color var(--transition);
}
.media-item:hover { border-color: var(--red); }
.media-item.selected { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  background: var(--red);
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
}
.media-item.selected .media-item-check { display: flex; }
.media-item-check svg { width: 12px; height: 12px; color: #fff; }

/* ── DASHBOARD QUICK ACTIONS ── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
}
.quick-action:hover {
  border-color: var(--red);
  box-shadow: 0 4px 12px rgba(230,0,18,0.1);
  color: var(--text);
}
.quick-action svg { width: 24px; height: 24px; color: var(--red); }
.quick-action span { font-size: 13px; font-weight: 600; }

/* ── ACTIVITY LOG ── */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.activity-dot.red    { background: var(--red); }
.activity-dot.green  { background: var(--success); }
.activity-dot.blue   { background: var(--info-text); }
.activity-dot.orange { background: var(--warning); }
.activity-text  { font-size: 13.5px; color: var(--text); flex: 1; line-height: 1.5; }
.activity-time  { font-size: 11px; color: var(--text-light); white-space: nowrap; margin-top: 2px; }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .media-grid { grid-template-columns: repeat(4, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ── UTILITIES ── */
.text-muted  { color: var(--text-muted) !important; }
.text-red    { color: var(--red) !important; }
.text-success { color: var(--success) !important; }
.fw-bold     { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.d-flex      { display: flex; }
.align-center { align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.mb-0        { margin-bottom: 0 !important; }
.mb-12       { margin-bottom: 12px; }
.mb-16       { margin-bottom: 16px; }
.mb-20       { margin-bottom: 20px; }
.mb-24       { margin-bottom: 24px; }
.mt-12       { margin-top: 12px; }
.mt-16       { margin-top: 16px; }
.mt-20       { margin-top: 20px; }
.w-100       { width: 100%; }
.divider     { height: 1px; background: var(--border); margin: 20px 0; }
