/* ============================================================
   Xuming.me — Admin Panel Styles
   ============================================================ */

/* ── Admin Nav ───────────────────────────────────────────────── */
.admin-nav {
  height: 52px;
  background: #0f0f0f;
  border-bottom: 1px solid #3f3f3f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-nav__left  { display: flex; align-items: center; gap: 8px; }
.admin-nav__back  {
  display: flex; align-items: center; gap: 4px;
  color: #aaa; font-size: 13px; text-decoration: none;
  transition: color .2s;
}
.admin-nav__back:hover { color: #f1f1f1; }
.admin-nav__sep   { color: #555; font-size: 13px; }
.admin-nav__title { color: #f1f1f1; font-size: 14px; font-weight: 600; }
.admin-nav__right { display: flex; align-items: center; gap: 12px; }
.admin-nav__user  { color: #aaa; font-size: 13px; }
.admin-nav__logout {
  color: #aaa; font-size: 13px; text-decoration: none;
  padding: 4px 10px; border: 1px solid #3f3f3f; border-radius: 16px;
  transition: color .2s, border-color .2s;
}
.admin-nav__logout:hover { color: #f1f1f1; border-color: #aaa; }
.admin-nav__link {
  color: #aaa; font-size: 13px; text-decoration: none;
  transition: color .2s;
}
.admin-nav__link:hover { color: #f1f1f1; }

/* ── Admin Body ──────────────────────────────────────────────── */
.admin-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── Stats Bar ───────────────────────────────────────────────── */
.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.admin-stat {
  background: #181818;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  padding: 12px 18px;
  min-width: 110px;
  text-align: center;
}
.admin-stat--total {
  background: #1a1a2e;
  border-color: #ff0000;
}
.admin-stat__num   { font-size: 22px; font-weight: 700; color: #f1f1f1; }
.admin-stat__label { font-size: 11px; color: #aaa; margin-top: 2px; }

/* ── Toolbar ─────────────────────────────────────────────────── */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.admin-header__title { font-size: 18px; font-weight: 600; color: #f1f1f1; }
.admin-header__count { font-size: 13px; color: #aaa; margin-top: 2px; }

.btn-add {
  background: #ff0000;
  color: #fff;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s;
}
.btn-add:hover { background: #cc0000; }

/* ── Channel Filter ──────────────────────────────────────────── */
.admin-channel-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-filter-btn {
  padding: 5px 14px;
  border-radius: 16px;
  background: #272727;
  color: #f1f1f1;
  font-size: 13px;
  transition: background .2s;
}
.admin-filter-btn:hover { background: #3f3f3f; }
.admin-filter-btn.active {
  background: #f1f1f1;
  color: #0f0f0f;
  font-weight: 600;
}

/* ── Table ───────────────────────────────────────────────────── */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table thead th {
  background: #181818;
  color: #aaa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid #3f3f3f;
  white-space: nowrap;
}
.admin-table tbody tr {
  border-bottom: 1px solid #272727;
  transition: background .15s;
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: #181818; }
.admin-table td { padding: 10px 14px; color: #f1f1f1; vertical-align: middle; }

.admin-thumb {
  width: 100px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: #272727;
}
.admin-title {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-empty {
  text-align: center;
  color: #aaa;
  padding: 40px;
}

.channel-badge {
  background: #272727;
  color: #aaa;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ── Action Buttons ──────────────────────────────────────────── */
.admin-actions { display: flex; gap: 6px; }
.btn-sm {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  background: #272727;
  color: #f1f1f1;
  transition: background .2s;
}
.btn-sm:hover { background: #3f3f3f; }
.btn-sm--danger { background: #3a1212; color: #ff6b6b; }
.btn-sm--danger:hover { background: #5a1a1a; }

/* ── Form Modal ──────────────────────────────────────────────── */
.form-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.form-modal-backdrop.open { display: flex; }

.form-modal {
  background: #181818;
  border: 1px solid #3f3f3f;
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.form-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #3f3f3f;
}
.form-modal__title { font-size: 16px; font-weight: 600; color: #f1f1f1; }
.form-modal__body  { padding: 20px; }

/* ── Confirm Modal ───────────────────────────────────────────── */
.confirm-modal {
  background: #181818;
  border: 1px solid #3f3f3f;
  border-radius: 10px;
  padding: 28px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.confirm-modal__icon  { margin-bottom: 12px; }
.confirm-modal__title { font-size: 18px; font-weight: 600; color: #f1f1f1; margin-bottom: 8px; }
.confirm-modal__text  { color: #aaa; font-size: 14px; margin-bottom: 20px; }

/* ── Form Elements ───────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: #aaa; margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid #3f3f3f;
  border-radius: 6px;
  color: #f1f1f1;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #aaa;
}
.form-textarea { resize: vertical; }
.form-select option { background: #181818; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-inline { display: flex; gap: 8px; }
.form-row-inline .form-input { flex: 1; }

.btn-fetch {
  background: #272727;
  color: #f1f1f1;
  border: 1px solid #3f3f3f;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
  transition: background .2s;
}
.btn-fetch:hover { background: #3f3f3f; }
.btn-fetch.loading { opacity: .6; pointer-events: none; }

.thumb-preview { margin-top: 8px; }
.thumb-preview img {
  max-width: 180px;
  border-radius: 4px;
  border: 1px solid #3f3f3f;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-cancel {
  background: #272727;
  color: #f1f1f1;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 14px;
  transition: background .2s;
}
.btn-cancel:hover { background: #3f3f3f; }
.btn-submit {
  background: #ff0000;
  color: #fff;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s;
}
.btn-submit:hover { background: #cc0000; }

.btn-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #aaa;
  transition: background .2s, color .2s;
}
.btn-icon:hover { background: #272727; color: #f1f1f1; }

/* ── Login Page ──────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f0f0f;
  padding: 20px;
}
.login-card {
  background: #181818;
  border: 1px solid #3f3f3f;
  border-radius: 12px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card__icon  { font-size: 40px; margin-bottom: 12px; }
.login-card__title { font-size: 22px; font-weight: 700; color: #f1f1f1; margin-bottom: 6px; }
.login-card__sub   { color: #aaa; font-size: 14px; margin-bottom: 24px; }
.login-error {
  background: #3a1212;
  color: #ff6b6b;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}
.btn-login {
  width: 100%;
  background: #ff0000;
  color: #fff;
  border-radius: 6px;
  padding: 10px;
  font-size: 15px;
  font-weight: 500;
  margin-top: 4px;
  transition: background .2s;
}
.btn-login:hover { background: #cc0000; }
.login-back {
  display: block;
  margin-top: 20px;
  color: #aaa;
  font-size: 13px;
  transition: color .2s;
}
.login-back:hover { color: #f1f1f1; }

/* ── Admin Section (profile / admins pages) ──────────────────── */
.admin-section {
  background: #181818;
  border: 1px solid #3f3f3f;
  border-radius: 10px;
  margin-bottom: 24px;
  overflow: hidden;
}
.admin-section .admin-toolbar {
  padding: 16px 20px 0;
  margin-bottom: 0;
}
.admin-section .admin-header { display: flex; align-items: center; gap: 10px; }

/* ── Toast notifications ─────────────────────────────────────── */
.admin-toast {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
}
.admin-toast--success { background: #1a3a1a; color: #6fcf6f; border: 1px solid #2d5a2d; }
.admin-toast--error   { background: #3a1212; color: #ff6b6b; border: 1px solid #5a2222; }

/* ── Small action buttons in tables ─────────────────────────── */
.btn-delete-small {
  background: transparent;
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-delete-small:hover { background: #ff6b6b; color: #fff; }

.btn-edit-small {
  color: #aaa;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.btn-edit-small:hover { color: #f1f1f1; border-color: #aaa; }
