/* Giao diện các trang đăng nhập / đăng ký / quên mật khẩu */
:root {
  --bg-sidebar: #f6f8f1;
  --bg-hover: #eaf0df;
  --ink: #1f2d16;
  --muted: #6f7d5c;
  --accent: #3a8a36;
  --accent-dark: #2d6e2a;
  --border: #dde3d2;
  --danger: #d33a2c;
  --ok: #2d8a4e;
}

* { box-sizing: border-box; }

/* Đảm bảo thuộc tính hidden luôn ẩn, kể cả khi phần tử có display: flex */
[hidden] { display: none !important; }

body.auth {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #cce08a 0%, #eef3df 60%, #ffffff 100%);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px 24px;
  box-shadow: 0 12px 40px rgba(36, 80, 36, 0.12);
}

/* Bố cục có thêm phần giới thiệu (trang đăng nhập): 2 cột trên desktop, xếp dọc trên mobile */
.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 44px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 840px;
}
.auth-layout .auth-card { margin: 0; flex: 0 0 auto; }

.auth-intro {
  flex: 1 1 300px;
  max-width: 400px;
  color: var(--ink);
}
.auth-intro-brand {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 10px;
}
.auth-intro-tag {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--accent-dark);
  margin: 0 0 22px;
}
.auth-features {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 0.93rem;
  line-height: 1.4;
  color: var(--ink);
}
.auth-features b { color: var(--accent-dark); font-weight: 700; }
.feat-ico {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 9px;
}
.auth-intro-foot {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
}

/* ===== Tối ưu riêng cho login (PC + mobile) ===== */
body.auth-login {
  position: relative;
  overflow: hidden;
  padding: 26px;
  font-family: 'Trebuchet MS', 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(135deg, #cce08a 0%, #eef3df 60%, #ffffff 100%);
}

.login-layout {
  position: relative;
  z-index: 1;
  max-width: 920px;
  gap: 22px;
  align-items: center;
  border: 1px solid rgba(58, 138, 54, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 48px rgba(26, 58, 38, 0.13);
  backdrop-filter: blur(6px);
  padding: 18px;
}

.login-intro {
  border: none;
  border-radius: 16px;
  background: transparent;
  padding: 14px 14px 14px 10px;
  box-shadow: none;
  animation: login-rise .45s ease;
}

.intro-illus {
  margin: -2px 0 10px;
  border: 1px solid rgba(58, 138, 54, 0.2);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(232, 244, 221, 0.9));
  padding: 10px;
}

.intro-illus-svg {
  display: block;
  width: 100%;
  height: auto;
}

.login-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 18px;
}

.login-stat {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
  background: #e8f3df;
  border: 1px solid #b7d3a8;
  border-radius: 999px;
  padding: 5px 11px;
}

.login-card {
  max-width: 400px;
  border: none;
  border-radius: 16px;
  padding: 14px 10px 8px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  animation: login-rise .5s ease;
}

.login-card .auth-brand {
  font-size: 1.95rem;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.login-card .auth-title {
  margin-bottom: 14px;
  color: var(--muted);
}

.login-card .auth-field input {
  min-height: 44px;
  border-radius: 12px;
  background: var(--bg-sidebar);
}

.login-card .auth-btn {
  min-height: 44px;
  font-size: 1rem;
  border-radius: 12px;
  background: linear-gradient(130deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 24px rgba(44, 122, 55, 0.26);
}

.login-card .auth-btn:hover {
  background: linear-gradient(130deg, var(--accent-dark), #245024);
}

.login-card .auth-links {
  margin-top: 12px;
  font-size: 0.84rem;
}

.auth-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.auth-links-row + .auth-links-row {
  margin-top: 4px;
}

.auth-links-row-muted a {
  color: var(--muted);
  font-size: 0.8rem;
}

.login-intro .auth-intro-brand {
  font-size: 2rem;
  margin-bottom: 12px;
}

.login-intro .auth-intro-tag {
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.58;
  color: var(--accent-dark);
}

.login-intro .auth-features li {
  font-size: 0.9rem;
}

.login-intro .feat-ico {
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.login-summary {
  margin-top: 12px;
  border: 1px dashed rgba(58, 138, 54, 0.38);
  border-radius: 12px;
  background: rgba(234, 240, 223, 0.35);
  padding: 10px 12px;
}

.login-summary-title {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.82rem;
}

.login-summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.81rem;
  color: #365a33;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .auth-layout { gap: 24px; }
  .auth-intro { flex-basis: auto; max-width: 380px; text-align: center; }
  .auth-features { text-align: left; max-width: 320px; margin-left: auto; margin-right: auto; }
  .auth-intro-brand { font-size: 1.5rem; }

  body.auth-login {
    padding: 12px;
    align-items: center;
    overflow-y: auto;
  }

  .login-layout {
    gap: 0;
    max-width: 370px;
    width: 100%;
    padding: 10px;
    border-radius: 18px;
  }

  .login-card {
    max-width: 360px;
    width: 100%;
    padding: 14px 10px 10px;
    border-radius: 14px;
    box-shadow: none;
    margin: 8px auto;
  }

  .login-intro {
    display: block;
    max-width: 360px;
    width: 100%;
    padding: 6px 6px 0;
    border-radius: 14px;
    margin: 0 auto 0;
  }

  .login-intro .intro-illus {
    margin: 0;
    padding: 7px;
  }

  .login-intro .auth-intro-brand {
    display: none;
  }

  .login-intro .auth-intro-tag {
    display: none;
  }

  .login-intro .login-stat-row {
    display: none;
  }

  .login-intro .auth-features,
  .login-intro .auth-intro-foot {
    display: none;
  }

  .login-card .auth-brand {
    font-size: 1.8rem;
  }

  .login-card .auth-title {
    margin-bottom: 10px;
  }

  .login-card .auth-links {
    line-height: 1.5;
    font-size: 0.8rem;
  }

  .login-card .auth-field {
    margin-bottom: 10px;
  }

  .login-summary {
    margin-top: 10px;
    padding: 8px 10px;
  }

  .login-summary-list {
    font-size: 0.78rem;
  }
}

.auth-brand {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.auth-title {
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 22px;
  font-weight: 500;
}

.auth-field { margin-bottom: 14px; }

.auth-field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.auth-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-sidebar);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.auth-field input:focus {
  border-color: var(--accent);
  background: #fff;
}

.auth-btn {
  width: 100%;
  padding: 11px;
  margin-top: 6px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-btn:hover { background: var(--accent-dark); }
.auth-btn:disabled { opacity: 0.6; cursor: default; }

.auth-links {
  margin-top: 18px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.auth-links a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover { text-decoration: underline; }

.auth-sep { margin: 0 6px; color: var(--border); }

.auth-msg {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.86rem;
  display: none;
}

.auth-msg.show { display: block; }
.auth-msg.error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.auth-msg.ok { background: #e8f6ee; color: var(--ok); border: 1px solid #bfe6cd; }

.auth-hint {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== Trang hồ sơ ===== */
.profile-card { max-width: 420px; }
.auth-field input:disabled {
  background: #eef1ea;
  color: var(--muted);
  cursor: not-allowed;
}

.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 18px rgba(36, 80, 36, 0.18);
  background: var(--bg-sidebar);
}
.profile-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--accent);
  background: linear-gradient(160deg, #eef3df, #dde9c9);
}
.profile-avatar-actions { display: flex; gap: 8px; align-items: center; }
.profile-avatar-btn {
  width: auto;
  margin: 0;
  padding: 8px 18px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.profile-avatar-remove {
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}
.profile-avatar-remove:hover { background: #fdecea; }

/* ===== Trang quản lý user (admin) ===== */
body.admin {
  display: block;
  background: var(--bg-sidebar);
  padding: 28px 18px;
}

.admin-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-head h1 {
  font-size: 1.3rem;
  margin: 0;
}

.admin-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-back {
  font-size: 0.88rem;
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}
.admin-back:hover { text-decoration: underline; }

.admin-count {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.admin-table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.admin-table th,
table.admin-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

table.admin-table th {
  background: var(--bg-sidebar);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tbody tr:hover { background: var(--bg-hover); }

.admin-badge {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
  vertical-align: middle;
}

.admin-num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-empty { padding: 28px; text-align: center; color: var(--muted); }
.admin-muted { color: var(--muted); font-style: italic; }

.status-badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: .76rem;
  font-weight: 600;
  border-radius: 11px;
}
.status-badge.approved { color: #1f7a3d; background: #e2f3e8; }
.status-badge.pending { color: #7a5200; background: #fbf0d2; }

.status-btn {
  padding: 4px 12px;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.status-btn.approve { color: #fff; background: var(--accent); border-color: var(--accent); }
.status-btn.approve:hover { background: var(--accent-dark); }
.status-btn.revoke { color: var(--muted); background: transparent; }
.status-btn.revoke:hover { background: var(--bg-hover); color: var(--ink); }

.admin-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(36, 80, 36, 0.06);
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.admin-pill-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: #bfd0b2;
  background: #fff;
}

.admin-pill-link-muted {
  background: #f9fbf6;
}

.admin-pill-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--accent-dark);
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-pill-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-pill-text strong {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.admin-pill-text small {
  font-size: 0.74rem;
  color: var(--muted);
}

.admin-search { margin-bottom: 10px; }
.admin-search input {
  width: 100%;
  padding: 10px 12px;
  font-size: .92rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.admin-search input:focus { border-color: var(--accent); }

.admin-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-filters input {
  flex: 1 1 auto;
}

.admin-filters select {
  flex: 0 0 220px;
  max-width: 100%;
  padding: 10px 12px;
  font-size: .92rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.admin-filters select:focus {
  border-color: var(--accent);
}

.note-preview { color: var(--muted); max-width: 320px; }
.admin-note-row { cursor: pointer; }
.admin-note-row td:last-child { cursor: default; }
.note-view {
  padding: 5px 12px;
  font-size: .82rem;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
}
.note-view:hover { background: var(--accent-dark); }

.note-detail-wrap {
  max-width: 980px;
}

.note-detail-head {
  align-items: flex-start;
}

.note-detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 26px rgba(36, 80, 36, 0.06);
}

.note-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.note-detail-meta-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-sidebar);
}

.note-detail-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.note-detail-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

.note-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.note-detail-media {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 16px;
}

.note-media-block {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fcfdf9;
}

.note-media-title {
  margin: 0 0 10px;
  font-size: 0.96rem;
}

.note-detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.note-detail-image-link {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}

.note-detail-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.note-detail-music iframe {
  display: block;
  width: 100%;
}

.note-detail-music-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.note-detail-music-link:hover {
  text-decoration: underline;
}

.note-detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.note-detail-content {
  margin: 0;
  min-height: 260px;
  padding: 14px 16px;
  background: #fcfdf9;
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  line-height: 1.65;
  color: var(--ink);
}

/* ===== Lịch sử thay đổi ghi chú (màn admin) ===== */
.note-history-card {
  margin-top: 16px;
}

.note-history-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.note-history-title {
  font-size: 1.2rem;
}

.note-history-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.note-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fcfdf9;
}

.history-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.history-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.history-badge-create {
  background: #e6f4ea;
  color: #1d7a3a;
}

.history-badge-update {
  background: #eef2ff;
  color: #3949ab;
}

.history-time {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.history-editor {
  font-size: 0.82rem;
  color: var(--muted);
}

.history-changes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-change {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: start;
}

.history-field {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  padding-top: 2px;
}

.history-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.history-old,
.history-new {
  display: inline-block;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.86rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-old {
  background: #fdecec;
  color: #a23b3b;
  text-decoration: line-through;
  text-decoration-color: rgba(162, 59, 59, 0.5);
}

.history-new {
  background: #e6f4ea;
  color: #1d7a3a;
}

.history-arrow {
  color: var(--muted);
  font-weight: 700;
}

.history-nochange {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 760px) {
  .history-change {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 760px) {
  body.users-page {
    padding: 14px 10px;
  }

  .users-page .admin-wrap {
    max-width: 100%;
  }

  .users-page .admin-head {
    gap: 8px;
    margin-bottom: 10px;
  }

  .users-page .admin-head h1 {
    font-size: 1.08rem;
  }

  .users-page .admin-subtitle {
    font-size: 0.8rem;
  }

  .users-page .admin-nav {
    width: 100%;
    gap: 8px;
  }

  .users-page .admin-pill-link {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 10px;
    gap: 8px;
  }

  .users-page .admin-pill-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.92rem;
  }

  .users-page .admin-pill-text strong {
    font-size: 0.82rem;
  }

  .users-page .admin-pill-text small {
    font-size: 0.7rem;
  }

  .users-page .admin-count {
    margin-bottom: 8px;
  }

  .admin-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-filters select {
    flex: 1 1 auto;
  }

  .users-page .admin-table-wrap {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .users-page table.admin-table {
    display: block;
    width: 100%;
    border-collapse: separate;
  }

  .users-page table.admin-table thead {
    display: none;
  }

  .users-page table.admin-table tbody {
    display: block;
  }

  .users-page table.admin-table tr {
    display: block;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  }

  .users-page table.admin-table td {
    display: grid;
    grid-template-columns: 118px 1fr;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.84rem;
    word-break: break-word;
  }

  .users-page table.admin-table td:last-child {
    border-bottom: none;
  }

  .users-page table.admin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .users-page .admin-num {
    text-align: left;
  }

  .users-page .status-btn {
    width: fit-content;
    min-width: 102px;
    padding: 6px 10px;
  }

  .users-page .admin-empty {
    display: block;
    padding: 18px 12px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
  }

  .users-page .admin-empty::before {
    content: none;
  }

  .note-detail-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .note-detail-card {
    padding: 14px;
  }

  .note-media-block {
    padding: 12px;
  }

  .note-detail-images {
    grid-template-columns: 1fr 1fr;
  }

  .note-detail-title {
    font-size: 1.2rem;
  }

  .note-detail-content {
    min-height: 180px;
    padding: 12px;
  }
}

/* ===== Quản lý ảnh: lưới thư viện ===== */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.img-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.img-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(36, 80, 36, 0.1);
  border-color: #bfd0b2;
}
.img-card.is-orphan { border-color: #e6c07a; background: #fffdf6; }

.img-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-sidebar);
  overflow: hidden;
}
.img-thumb img,
.img-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-kind-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
}

.img-info {
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.img-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.img-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.img-tag {
  display: inline-block;
  max-width: 100%;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-tag-note { color: #1f5c7a; background: #e2eef3; }
.img-tag-cover { color: #6a3d7a; background: #f0e2f3; }
.img-tag-orphan { color: #7a5200; background: #fbf0d2; }

.img-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(180, 40, 40, 0.82);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.img-card:hover .img-del { opacity: 1; }
.img-del:hover { background: rgba(150, 20, 20, 0.95); }

/* Lightbox xem phóng to */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
}
.lightbox-img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

@media (max-width: 620px) {
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .img-del { opacity: 1; }
}
