/* ==========================================================================
   2D/3D AVN Hub+ Community — Light Theme with Emerald • Red • Purple Borders
   ========================================================================== */

:root {
  --bg-page: #f5f7fb;
  --bg-surface: #ffffff;
  --bg-subtle: #eef2f8;
  --text-main: #181c2e;
  --text-muted: #5a627a;
  --text-light: #8891aa;

  /* Core Brand Accent Colors: Emerald Jade, Crimson Red, Royal Purple */
  --jade: #00c48c;
  --jade-dark: #009e70;
  --crimson: #f43f5e;
  --purple: #8b5cf6;
  --purple-dark: #6d28d9;

  --tri-gradient: linear-gradient(125deg, #00c48c 0%, #f43f5e 52%, #8b5cf6 100%);
  --tri-gradient-soft: linear-gradient(125deg, rgba(0, 196, 140, 0.12) 0%, rgba(244, 63, 94, 0.10) 52%, rgba(139, 92, 246, 0.12) 100%);

  --shadow-sm: 0 4px 14px rgba(24, 28, 46, 0.05);
  --shadow-md: 0 10px 28px rgba(24, 28, 46, 0.09);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 18px;
}

.hidden {
  display: none !important;
}

/* ==================== TRI-COLOR BORDER UTILITIES (JADE • RED • PURPLE) ==================== */
.tri-border-card {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background-image: linear-gradient(var(--bg-surface), var(--bg-surface)), var(--tri-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: var(--shadow-sm);
}

.tri-border-box {
  border: 2.5px solid transparent;
  background-image: linear-gradient(var(--bg-surface), var(--bg-surface)), var(--tri-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.tri-border-bottom {
  border-bottom: 3px solid transparent;
  background-image: linear-gradient(var(--bg-surface), var(--bg-surface)), var(--tri-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.tri-border-top {
  border-top: 3px solid transparent;
  background-image: linear-gradient(var(--bg-surface), var(--bg-surface)), var(--tri-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.gradient-text {
  background: var(--tri-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* ==================== TOP BANNER & NAVBAR ==================== */
.site-banner {
  background: var(--tri-gradient);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 7px 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.banner-pill {
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--purple-dark);
}

.brand-text h1 {
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.brand-text p {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 5px;
  border-radius: 14px;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.65);
}

.nav-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  border: 1.5px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--tri-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.nav-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.user-chip:hover {
  transform: translateY(-1px);
}

.user-chip img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-chip-name {
  font-size: 0.86rem;
  font-weight: 700;
}

/* ==================== ROLE & VIP BADGES ==================== */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-admin {
  background: linear-gradient(135deg, #f43f5e, #8b5cf6);
  color: #ffffff;
}

.badge-mod {
  background: linear-gradient(135deg, #00c48c, #0ea5e9);
  color: #ffffff;
}

.badge-creator {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
}

.badge-vip {
  background: linear-gradient(135deg, #f59e0b, #f43f5e);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.25);
}

.badge-member {
  background: #e6f9f3;
  color: #008a63;
  border: 1px solid #a7f3d0;
}

.badge-guest {
  background: #eef2f8;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: var(--tri-gradient);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.22);
}

.btn-primary:hover {
  opacity: 0.93;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1.5px solid #d5dceb;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 15px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  border-color: var(--jade);
  background: #f5fffc;
}

.btn-danger {
  background: #fff1f3;
  color: #e11d48;
  border: 1px solid #fecdd3;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger:hover {
  background: #ffe4e6;
}

.small-btn {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.full-width {
  width: 100%;
}

/* ==================== MAIN LAYOUT & SECTIONS ==================== */
.main-wrapper {
  padding-top: 24px;
  padding-bottom: 48px;
  flex: 1;
}

.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

.section-header-card {
  padding: 20px 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.42rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sub-header h3 {
  font-size: 1.12rem;
  font-weight: 800;
}

.sub-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==================== FEATURED GAMES & PORTAL GRID ==================== */
.featured-wrapper {
  margin-bottom: 26px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.featured-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.game-cover-wrap {
  position: relative;
  height: 195px;
  background: #e2e8f0;
  overflow: hidden;
}

.game-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--tri-gradient);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.cat-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
}

.game-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.game-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
}

.game-desc-short {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Download Link Access Box inside Card */
.download-access-box {
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 12px;
  border: 1px solid #dde3f0;
}

.guest-lock-msg {
  font-size: 0.83rem;
  color: #b91c1c;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.dl-link-btn {
  text-decoration: none;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 0.78rem;
}

.dl-normal {
  background: #e0f2fe;
  color: #0369a1;
}

.dl-vip {
  background: linear-gradient(135deg, #f59e0b, #f43f5e);
  color: #ffffff;
}

.dl-vip-locked {
  background: #f1f5f9;
  color: #64748b;
  border: 1px dashed #cbd5e1;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #edf0f7;
  font-size: 0.82rem;
}

.author-inline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.author-inline img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.filter-bar {
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1.5px solid #dce2ef;
  background: #f8fafd;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip.active, .chip:hover {
  background: var(--tri-gradient-soft);
  color: var(--text-main);
  border-color: var(--purple);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 8px 14px;
  border-radius: 999px;
  min-width: 260px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.88rem;
  color: var(--text-main);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.empty-state-box {
  grid-column: 1 / -1;
  padding: 36px 24px;
  text-align: center;
}

.empty-state-box h4 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}

.empty-state-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ==================== FACEBOOK-STYLE COMMUNITY FORUM ==================== */
.fb-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1040px) {
  .fb-layout {
    grid-template-columns: 1fr;
  }
}

.fb-card {
  padding: 18px;
  margin-bottom: 18px;
}

.group-cover-mini {
  background: var(--tri-gradient);
  color: #ffffff;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.group-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 5px;
}

.group-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.group-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  background: var(--bg-subtle);
  padding: 10px 6px;
  border-radius: 10px;
}

.group-stats strong {
  display: block;
  font-size: 1.05rem;
  color: var(--purple-dark);
}

.group-stats span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.divider {
  border: none;
  border-top: 1px solid #e6ebf5;
  margin: 14px 0;
}

.topic-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topic-btn {
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}

.topic-btn:hover, .topic-btn.active {
  background: var(--tri-gradient-soft);
  color: var(--text-main);
}

.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* Forum Post Composer */
.composer-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.composer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.composer-inputs {
  flex: 1;
}

.composer-textarea {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  resize: vertical;
  min-height: 76px;
  outline: none;
  background: #f8fafd;
}

.composer-textarea:focus {
  border-color: var(--jade);
  background: #ffffff;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-select {
  border: 1.5px solid #dce2ef;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--text-main);
}

.img-counter-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--purple-dark);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.preview-thumb {
  position: relative;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #dce2ef;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-thumb-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(24, 28, 46, 0.78);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

/* Forum Post Card */
.post-card {
  padding: 18px;
  margin-bottom: 18px;
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.post-author-box {
  display: flex;
  align-items: center;
  gap: 11px;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.post-author-name {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-meta-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-pill {
  background: var(--tri-gradient-soft);
  color: var(--purple-dark);
  padding: 1px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.post-body-text {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 12px;
  white-space: pre-line;
}

/* Facebook-style 1, 2, or 3 Image Collage */
.post-images-collage {
  display: grid;
  gap: 6px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}

.post-images-collage.count-1 {
  grid-template-columns: 1fr;
}

.post-images-collage.count-2 {
  grid-template-columns: 1fr 1fr;
}

.post-images-collage.count-3 {
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 155px 155px;
}

.post-images-collage.count-3 img:first-child {
  grid-row: span 2;
  height: 316px;
}

.post-images-collage img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
  transition: filter 0.15s ease;
}

.post-images-collage.count-3 img {
  height: 155px;
}

.post-images-collage img:hover {
  filter: brightness(0.94);
}

.post-stats-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-bottom: 9px;
  border-bottom: 1px solid #edf0f7;
}

.post-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #edf0f7;
}

.post-action-btn {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}

.post-action-btn:hover {
  background: var(--bg-subtle);
}

.post-action-btn.liked {
  color: var(--crimson);
}

/* Comments Area */
.comments-section {
  margin-top: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.comment-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.comment-item img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 2px;
}

.comment-bubble {
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: 13px;
  font-size: 0.85rem;
  flex: 1;
}

.comment-author {
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.comment-form input {
  flex: 1;
  border: 1.5px solid #dce2ef;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.84rem;
  outline: none;
}

.comment-form input:focus {
  border-color: var(--purple);
}

/* Right Sidebar Legends */
.role-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
}

.legend-item:last-child {
  border-bottom: none;
}

.legend-item small {
  font-size: 0.79rem;
  color: var(--text-muted);
}

.top-members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.top-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==================== ADMIN & MOD PANEL ==================== */
.mod-notice-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #92400e;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-box {
  padding: 16px 18px;
}

.stat-box span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-box h4 {
  font-size: 1.65rem;
  font-weight: 900;
  margin-top: 4px;
}

.admin-subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-sub-panel {
  display: none;
  padding: 18px;
}

.admin-sub-panel.active {
  display: block;
}

.table-responsive {
  overflow-x: auto;
}

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

.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #edf0f7;
}

.admin-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.role-select-admin {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  font-weight: 700;
  font-size: 0.82rem;
}

/* ==================== MODALS & FORMS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
}

.modal-lg {
  max-width: 680px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.close-btn {
  border: none;
  background: var(--bg-subtle);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  cursor: pointer;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.auth-tab-btn {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab-btn.active {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-group input, .form-group select, .form-group textarea {
  border: 1.5px solid #dce2ef;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--purple);
}

.avatar-upload-section {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-subtle);
  padding: 12px;
  border-radius: 14px;
}

.avatar-preview-ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-preview-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-avatars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-avatar-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.preset-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-upload-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

/* Lightbox */
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 14px;
  border: 3px solid #ffffff;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--crimson);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #181c2e;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--jade);
  animation: slideIn 0.22s ease;
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.footer {
  background: #ffffff;
  padding: 18px 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
