/* ── ADMIN LAYOUT ── */
.admin-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── STATS ── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
}
.stat-card-num {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card-label {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

/* ── ADMIN CARD ── */
.admin-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.admin-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.admin-card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.admin-search {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--r);
  outline: none;
  width: 240px;
  color: var(--text);
  background: var(--bg2);
}
.admin-search:focus { border-color: var(--teal); }

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--text3);
  font-size: 14px;
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.user-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.user-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: var(--bg2); }

.user-email-cell { display: flex; align-items: center; gap: 8px; }
.email-text { font-weight: 500; color: var(--text); }
.date-cell { color: var(--text2); font-size: 12px; }

.you-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--teal-light);
  color: var(--teal);
  padding: 2px 7px;
  border-radius: 10px;
}

/* Role */
.role-cell { display: flex; align-items: center; gap: 8px; }
.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.role-admin { background: var(--teal-light); color: var(--teal); }
.role-user  { background: var(--bg3); color: var(--text2); }

.btn-tiny {
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  padding: 3px 8px;
  border: 1px solid var(--border2);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  color: var(--text2);
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-tiny:hover { border-color: var(--teal); color: var(--teal); }

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 22px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--teal); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* Delete button */
.btn-delete {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  color: var(--text3);
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.btn-delete:hover { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }

/* Danger button */
.btn-danger-solid {
  background: #DC2626;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger-solid:hover { background: #B91C1C; }

/* User role badge in nav */
.user-role-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--teal);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  max-width: 400px;
  width: 90%;
}
.modal h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}
.modal p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-actions { display: flex; gap: 10px; }

.no-results {
  text-align: center;
  padding: 40px;
  color: var(--text3);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-search { width: 160px; }
}

/* ── OVERRIDE demo-body for admin ── */
.demo-body { overflow: auto; height: auto; min-height: 100vh; }
.admin-layout { padding-top: 24px; }
