/* =========================================================
   MuseNest Dashboard — dashboard.css
   Bootstrap 5.3 + custom layout shell
   ========================================================= */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
  --header-height: 64px;
  --content-max-width: 1400px;
  --content-padding: 24px;

  /* MuseNest brand palette */
  --mn-primary: #9E3950;
  --mn-primary-light: #9E3950;
  --mn-sidebar-bg: #1B1613;
  --mn-sidebar-text: #6E655D;
  --mn-sidebar-active-bg: rgba(79, 70, 229, 0.15);
  --mn-sidebar-active-text: #D8909F;
  --mn-sidebar-hover-bg: rgba(255, 255, 255, 0.05);
  --mn-sidebar-border: rgba(255, 255, 255, 0.06);
  --mn-header-bg: #ffffff;
  --mn-header-border: #E8E0D7;
  --mn-content-bg: #FCFAF7;

  /* Status badge colors */
  --mn-badge-approved: #2F6B4F;
  --mn-badge-pending: #8A5A12;
  --mn-badge-flagged: #B5652A;
  --mn-badge-rejected: #A32B2B;
  --mn-badge-error: #A32B2B;
  --mn-badge-archived: #574E48;
  --mn-badge-active: #2F6B4F;
  --mn-badge-suspended: #B5652A;
  --mn-badge-critical: #A32B2B;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}

/* ── Layout ──────────────────────────────────────────────── */
html, body {
  height: 100%;
}

.dashboard-body {
  background: var(--mn-content-bg);
  font-family: 'Slippy', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  color: #3D352F;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.dashboard-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--mn-sidebar-bg) !important;
  background-color: var(--mn-sidebar-bg) !important;
  color: var(--mn-sidebar-text);
  display: flex !important;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1045;
  transition: width 0.2s ease, transform 0.3s ease;
  overflow: hidden;
  visibility: visible !important;
}

.dashboard-sidebar.sidebar-collapsed {
  width: var(--sidebar-collapsed-width);
}

.dashboard-sidebar.sidebar-hidden {
  width: 0;
  min-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar-hidden ~ .dashboard-wrapper {
  margin-left: 0;
}

.sidebar-hidden ~ .dashboard-wrapper .dashboard-header {
  padding-left: 56px; /* clear the floating M button */
}

/* Floating toggle to reopen sidebar */
.sidebar-show-btn {
  position: fixed;
  top: 14px;
  left: 10px;
  z-index: 1050;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(158, 57, 80, .14);
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: opacity .15s, transform .15s;
  padding: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.sidebar-show-btn img { width: 28px; height: 16px; object-fit: contain; display: block; }
.sidebar-show-btn:hover {
  transform: scale(1.08);
  opacity: .9;
}
.sidebar-hidden ~ .dashboard-wrapper .sidebar-show-btn,
body:has(.sidebar-hidden) .sidebar-show-btn {
  display: flex;
}

/* Brand / Logo area */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--header-height);
  border-bottom: 1px solid var(--mn-sidebar-border);
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 40px;
  height: 32px;
  background: #fff;
  border: 1px solid rgba(158, 57, 80, .14);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(57, 39, 32, .08);
}
.sidebar-brand-icon img { width: 34px; height: 20px; object-fit: contain; display: block; }
.sidebar-collapsed .sidebar-brand { padding-inline: 12px; }

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 700;
  color: #F5EFE8;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.15s ease;
  letter-spacing: -0.3px;
}
.sidebar-brand-wordmark-text {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  line-height: .78;
  letter-spacing: -.025em;
  color: inherit;
}
.sidebar-brand-product-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sidebar-brand-club-label { font-size: 10px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }

/* Two lines now: the product, and whose account this is. */
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
}
.sidebar-brand-model {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  /* Inherits the sidebar's own text colour so it stays legible on the light
     dashboard and on the Club overlay's dark chrome alike. A fixed hex only
     ever suits one of them. */
  color: inherit;
  opacity: .72;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-collapsed .sidebar-brand-text {
  opacity: 0;
  pointer-events: none;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.5);
  padding: 16px 20px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.sidebar-collapsed .sidebar-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
}

/* Collapsible sidebar sections (e.g. Paysite). The section header is a
   button that toggles the body. State persists in localStorage. */
/* The Paysite section toggle uses .sidebar-nav-item for typography +
   geometry (font, color, padding, hover, active) and only overrides
   the things a button-as-nav-item needs to reset (default button bg/
   border) and the chevron placement on the right. */
.sidebar-section-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: calc(100% - 16px); /* match .sidebar-nav-item margin: 2px 8px */
}
.sidebar-section-toggle .sidebar-section-chevron {
  margin-left: auto; width: 12px; height: 12px;
  transition: transform 0.15s ease; opacity: 0.6;
  flex-shrink: 0;
}
.sidebar-section--collapsed .sidebar-section-chevron { transform: rotate(-90deg); }
.sidebar-section--collapsed .sidebar-section-body { display: none; }
.sidebar-section-badge {
  background: #2F6B4F; color: #fff;
  font-size: 9px; padding: 1px 5px; border-radius: 8px;
  letter-spacing: 0.04em;
}

/* Indent the items inside a collapsible section body so they read as
   children of the section header, with a hairline left guide for the
   "child of paysite" visual cue. */
.sidebar-section--collapsible .sidebar-section-body {
  padding-left: 16px;
  margin-left: 16px;
  border-left: 1px solid var(--mn-admin-border, rgba(255, 255, 255, 0.07));
  margin-top: 2px;
  margin-bottom: 6px;
}
.sidebar-section--collapsible .sidebar-section-body .sidebar-nav-item {
  /* Override .sidebar-nav-item's 2px 8px outer margin so the items
     hug the guide line instead of floating away from it. */
  margin-left: 0;
  margin-right: 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--mn-sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  margin: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-nav-item:hover {
  background: var(--mn-sidebar-hover-bg);
  color: #E8E0D7;
}

.sidebar-nav-item.active {
  background: var(--mn-sidebar-active-bg);
  color: var(--mn-sidebar-active-text);
  font-weight: 500;
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #9E3950;
  border-radius: 0 3px 3px 0;
}

.sidebar-nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.sidebar-nav-item.active .nav-icon {
  opacity: 1;
}

.sidebar-nav-item .nav-label {
  font-size: 14px;
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #A32B2B;
  color: #fff;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.sidebar-collapsed .sidebar-nav-item .nav-label,
.sidebar-collapsed .sidebar-nav-item .nav-badge {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--mn-sidebar-border);
  padding: 8px;
  flex-shrink: 0;
}

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  color: var(--mn-sidebar-text);
  background: none;
  border: none;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.15s ease;
}

.sidebar-footer-btn:hover {
  background: var(--mn-sidebar-hover-bg);
  color: #E8E0D7;
}

.sidebar-footer-btn .nav-label {
  opacity: 1;
  transition: opacity 0.15s ease;
}
.sidebar-collapsed .sidebar-footer-btn .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* ── Main wrapper ─────────────────────────────────────────── */
.dashboard-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
  min-height: 100vh;
}

.sidebar-collapsed ~ .dashboard-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

/* ── Header ──────────────────────────────────────────────── */
.dashboard-header {
  height: var(--header-height);
  background: var(--mn-header-bg);
  border-bottom: 1px solid var(--mn-header-border);
  display: flex;
  align-items: center;
  padding: 0 var(--content-padding);
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1030;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.header-hamburger {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #574E48;
  border-radius: 8px;
  display: none;
  align-items: center;
  transition: all 0.15s ease;
}

.header-hamburger:hover {
  background: #F5EFE8;
  color: #1B1613;
}

.header-title-area {
  flex: 1;
  min-width: 0;
}

.header-page-title {
  font-size: 16px;
  font-weight: 600;
  color: #1B1613;
  margin: 0;
  line-height: 1.2;
}

.header-breadcrumb {
  font-size: 12px;
  color: #6E655D;
  margin: 2px 0 0;
}

.header-breadcrumb a {
  color: #6E655D;
  text-decoration: none;
  transition: color 0.15s ease;
}
.header-breadcrumb a:hover {
  color: var(--mn-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: none;
  border: 1px solid #E8E0D7;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #1B1613;
  text-decoration: none;
  transition: all 0.15s ease;
}
.header-user-btn:hover {
  background: #FCFAF7;
  border-color: #D8CEC4;
}

.header-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #9E3950, #9E3950);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Impersonation banner */
.impersonation-banner {
  background: linear-gradient(90deg, #FBF0DF, #EBD9AE);
  border-bottom: 2px solid #8A5A12;
  padding: 8px var(--content-padding);
  font-size: 13px;
  font-weight: 500;
  color: #7A5417;
  display: flex;
  align-items: center;
  gap: 8px;
}

.impersonation-banner a {
  color: #7A5417;
  font-weight: 600;
  text-decoration: underline;
  margin-left: auto;
}

/* ── Content area ────────────────────────────────────────── */
.dashboard-content {
  flex: 1;
  padding: var(--content-padding);
  overflow-x: hidden;
}

.dashboard-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* ── Welcome hero ────────────────────────────────────────── */
.welcome-hero {
  background: linear-gradient(135deg, #9E3950 0%, #7A2A3C 50%, #9E3950 100%);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25);
  position: relative;
  overflow: hidden;
}

.welcome-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-hero-content {
  position: relative;
  z-index: 1;
}

.welcome-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.welcome-hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin: 0;
}

.welcome-hero-actions {
  position: relative;
  z-index: 1;
}

.welcome-hero-actions .btn-light {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  backdrop-filter: blur(4px);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.welcome-hero-actions .btn-light:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-1px);
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #1B1613;
  margin: 0;
  letter-spacing: -0.3px;
}

.page-header-subtitle {
  font-size: 14px;
  color: #574E48;
  margin: 4px 0 0;
}

/* ── Gradient stat cards ─────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid #E8E0D7;
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

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

.stat-card-gradient {
  border: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 130px;
}

.stat-card-gradient::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.stat-card-gradient::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: 20%;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.stat-gradient-blue {
  background: linear-gradient(135deg, #1B6FA8, #155A88);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.stat-gradient-green {
  background: linear-gradient(135deg, #2F6B4F, #255740);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.stat-gradient-amber {
  background: linear-gradient(135deg, #8A5A12, #6F480E);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.stat-gradient-purple {
  background: linear-gradient(135deg, #7A2A3C, #63202F);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.stat-gradient-red {
  background: linear-gradient(135deg, #A32B2B, #8E2323);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.stat-gradient-cyan {
  background: linear-gradient(135deg, #1B6FA8, #1B6FA8);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.stat-card-gradient .stat-card-body {
  position: relative;
  z-index: 1;
}

.stat-card-gradient .stat-card-label {
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  margin: 0 0 8px;
}

.stat-card-gradient .stat-card-value {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.stat-card-gradient .stat-card-trend {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card-icon-float {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  z-index: 1;
}

/* Original flat stat cards (kept for non-gradient usage) */
.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.stat-card-icon.bg-primary-soft { background: rgba(79,70,229,0.1); color: #9E3950; }
.stat-card-icon.bg-success-soft { background: rgba(16,185,129,0.1); color: #2F6B4F; }
.stat-card-icon.bg-warning-soft { background: rgba(245,158,11,0.1); color: #8A5A12; }
.stat-card-icon.bg-danger-soft  { background: rgba(239,68,68,0.1); color: #A32B2B; }
.stat-card-icon.bg-info-soft    { background: rgba(6,182,212,0.1); color: #1B6FA8; }
.stat-card-icon.bg-secondary-soft { background: rgba(100,116,139,0.1); color: #574E48; }

.stat-card-body {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #574E48;
  margin: 0 0 4px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: #1B1613;
  line-height: 1;
  margin: 0;
}

.stat-card-trend {
  font-size: 12px;
  margin: 6px 0 0;
}

.stat-card-trend.trend-up   { color: #2F6B4F; }
.stat-card-trend.trend-down { color: #A32B2B; }
.stat-card-trend.trend-flat { color: #574E48; }

/* ── Dashboard cards (charts, tables, etc.) ──────────────── */
.dashboard-card {
  background: #fff;
  border: 1px solid #E8E0D7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #F5EFE8;
}

.dashboard-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1B1613;
  margin: 0;
}

.dashboard-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-card-body {
  padding: 20px;
}

/* ── Quick action cards ──────────────────────────────────── */
.quick-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #E8E0D7;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.quick-action-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #D8CEC4;
  transform: translateY(-2px);
  color: inherit;
}

.quick-action-card:hover .quick-action-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-action-icon.qa-blue   { background: rgba(59,130,246,0.1); color: #1B6FA8; }
.quick-action-icon.qa-green  { background: rgba(16,185,129,0.1); color: #2F6B4F; }
.quick-action-icon.qa-cyan   { background: rgba(6,182,212,0.1); color: #1B6FA8; }
.quick-action-icon.qa-amber  { background: rgba(245,158,11,0.1); color: #8A5A12; }
.quick-action-icon.qa-purple { background: rgba(139,92,246,0.1); color: #7A2A3C; }
.quick-action-icon.qa-red    { background: rgba(239,68,68,0.1); color: #A32B2B; }

.quick-action-body {
  flex: 1;
  min-width: 0;
}

.quick-action-title {
  font-size: 14px;
  font-weight: 600;
  color: #1B1613;
  margin: 0 0 2px;
}

.quick-action-desc {
  font-size: 12px;
  color: #6E655D;
  margin: 0;
}

.quick-action-arrow {
  color: #D8CEC4;
  flex-shrink: 0;
  opacity: 0;
  transition: all 0.2s ease;
}

/* ── Table toolbar ───────────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0 12px;
}

.table-toolbar .search-input {
  min-width: 220px;
}

.table-toolbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Data table ──────────────────────────────────────────── */
.dashboard-table {
  background: #fff;
  border: 1px solid #E8E0D7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.dashboard-table table {
  margin: 0;
  font-size: 14px;
}

.dashboard-table thead th {
  background: #FCFAF7;
  border-bottom: 1px solid #E8E0D7;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #574E48;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  padding: 12px 16px;
}

.dashboard-table thead th:hover {
  color: #1B1613;
}

.dashboard-table thead th.sort-asc::after  { content: ' ↑'; }
.dashboard-table thead th.sort-desc::after { content: ' ↓'; }

.dashboard-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #F5EFE8;
  color: #3D352F;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-table tbody tr:hover {
  background: #FCFAF7;
}

.dashboard-table tbody tr[data-href] {
  cursor: pointer;
}

/* Responsive column hiding */
@media (max-width: 767px) {
  .col-priority-low    { display: none !important; }
}
@media (max-width: 991px) {
  .col-priority-medium { display: none !important; }
}

/* ── Status badges ───────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

.badge-approved, .badge-active  { background: rgba(16,185,129,0.1);  color: var(--mn-badge-active); }
.badge-pending                  { background: rgba(245,158,11,0.12); color: #8A5A12; }
.badge-flagged, .badge-suspended{ background: rgba(249,115,22,0.1);  color: #B5652A; }
.badge-rejected, .badge-error   { background: rgba(239,68,68,0.1);  color: var(--mn-badge-rejected); }
.badge-archived, .badge-inactive{ background: rgba(100,116,139,0.1); color: var(--mn-badge-archived); }
.badge-critical                 { background: #A32B2B; color: #fff; font-size: 10px; padding: 3px 8px; }

/* Priority badges in moderation queue */
.priority-critical { background: #A32B2B; color: #fff; }
.priority-high     { background: rgba(239,68,68,0.1); color: #A32B2B; }
.priority-medium   { background: rgba(245,158,11,0.12); color: #8A5A12; }
.priority-low      { background: rgba(100,116,139,0.1); color: #574E48; }

/* ── Pagination ──────────────────────────────────────────── */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #E8E0D7;
  font-size: 13px;
  color: #574E48;
  flex-wrap: wrap;
  gap: 8px;
}

.table-pagination .pagination {
  margin: 0;
}

/* ── Media grid ──────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.media-card {
  background: #fff;
  border: 1px solid #E8E0D7;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.media-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #F5EFE8;
}

.media-card-body {
  padding: 8px 10px;
}

.media-card-filename {
  font-size: 12px;
  font-weight: 500;
  color: #3D352F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 4px;
}

/* ── Moderation queue cards ──────────────────────────────── */
.mod-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.mod-card {
  background: #fff;
  border: 1px solid #E8E0D7;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.mod-card:hover {
  box-shadow: var(--shadow-md);
}

.mod-card.priority-critical-card {
  border-color: #A32B2B;
  border-width: 2px;
}

.mod-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #F5EFE8;
}

.mod-card-body {
  padding: 12px;
}

/* ── Loading skeleton ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #F5EFE8 25%, #E8E0D7 50%, #F5EFE8 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: #6E655D;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h5 {
  font-weight: 600;
  color: #3D352F;
}

/* ── Card defaults ───────────────────────────────────────── */
.card {
  border-color: #E8E0D7;
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: #fff;
  border-bottom-color: #F5EFE8;
  font-weight: 600;
  font-size: 14px;
}

/* ── Loading overlay ─────────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

/* ── Toast container ─────────────────────────────────────── */
#toast-container {
  z-index: 1090;
}

/* ── Avatar ──────────────────────────────────────────────── */
.model-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #E8E0D7;
  flex-shrink: 0;
}

.model-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #9E3950, #9E3950);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Upload zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed #D8CEC4;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--mn-primary);
  background: rgba(79,70,229,0.03);
}

/* ── Category filter tabs ────────────────────────────────── */
.category-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 0 16px;
}

.category-tab {
  padding: 6px 16px;
  border: 1px solid #E8E0D7;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #574E48;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.category-tab:hover {
  border-color: var(--mn-primary);
  color: var(--mn-primary);
}

.category-tab.active {
  background: var(--mn-primary);
  border-color: var(--mn-primary);
  color: #fff;
}

/* ── Section heading ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1B1613;
  margin: 0;
}

/* ── Form controls polish ────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: #D8909F;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-select-sm {
  border-radius: 8px;
  border-color: #E8E0D7;
  font-size: 13px;
  color: #4A423B;
}

/* ── Responsive — mobile sidebar becomes Offcanvas ───────── */
@media (max-width: 991.98px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
  }

  .dashboard-sidebar.show {
    transform: translateX(0);
  }

  .dashboard-wrapper {
    margin-left: 0 !important;
  }

  .header-hamburger {
    display: flex;
  }

  .welcome-hero {
    padding: 20px;
    border-radius: 12px;
  }

  .welcome-hero-title {
    font-size: 18px;
  }

  .stat-card-gradient .stat-card-value {
    font-size: 26px;
  }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

/* ── Font import (Inter for cleaner look) ────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Billing Banner ───────────────────────────────────────── */
.mn-billing-banner {
  border-radius: 14px;
  padding: 18px 22px;
  border: 1.5px solid transparent;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.mn-billing-blue   { border-color: #9CC3DC; background: #EFF4F8; }
.mn-billing-green  { border-color: #A8CBB8; background: #EFF6F2; }
.mn-billing-yellow { border-color: #D8B269; background: #FDF7EC; }
.mn-billing-red    { border-color: #D9A5A5; background: #FBF1F1; }

.mn-billing-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.mn-billing-blue   .mn-billing-icon { background: #E4EEF5; color: #1B6FA8; }
.mn-billing-green  .mn-billing-icon { background: #E6F0EA; color: #2F6B4F; }
.mn-billing-yellow .mn-billing-icon { background: #FBF0DF; color: #6F480E; }
.mn-billing-red    .mn-billing-icon { background: #F3DEDE; color: #8E2323; }

.mn-billing-body { flex: 1; min-width: 0; }

.mn-billing-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 0 0 3px;
}
.mn-billing-blue   .mn-billing-label { color: #155A88; }
.mn-billing-green  .mn-billing-label { color: #2F6B4F; }
.mn-billing-yellow .mn-billing-label { color: #8A5A12; }
.mn-billing-red    .mn-billing-label { color: #8E2323; }

.mn-billing-amount {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.1;
}
.mn-billing-blue   .mn-billing-amount { color: #155A88; }
.mn-billing-green  .mn-billing-amount { color: #2F6B4F; }
.mn-billing-yellow .mn-billing-amount { color: #7A5417; }
.mn-billing-red    .mn-billing-amount { color: #8E2323; }

.mn-billing-meta {
  font-size: 13px;
  color: #574E48;
  margin: 4px 0 0;
}
.mn-billing-detail {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.mn-billing-chip {
  font-size: 12px;
  background: rgba(0,0,0,.05);
  border-radius: 6px;
  padding: 4px 10px;
  color: #4A423B;
  white-space: nowrap;
}
.mn-billing-chip strong { color: #1B1613; }

.mn-billing-progress-track {
  height: 7px;
  background: #E8E0D7;
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0 4px;
}
.mn-billing-progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
}
.mn-billing-yellow .mn-billing-progress-bar { background: linear-gradient(90deg, #B58A38, #8A5A12); }
.mn-billing-red    .mn-billing-progress-bar { background: linear-gradient(90deg, #C06B6B, #A32B2B); }
.mn-billing-green  .mn-billing-progress-bar { background: linear-gradient(90deg, #5E9E80, #2F6B4F); }

/* ==========================================================================
   Attention tiles — PRD-DASH-02
   Replaces the media-count stat cards on dashboard home. Every tile is a link;
   a count with no destination is a dead end. A zero tile is muted and sorts
   last rather than being hidden — absence and zero mean different things.
   ========================================================================== */

.mn-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.mn-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--mn-admin-surface, #fff);
  border: 1px solid var(--mn-admin-border, #E8E0D7);
  text-decoration: none;
  transition: border-color .16s ease;
}
.mn-tile:hover { border-color: var(--mn-admin-border-strong, #D8CEC4); }
.mn-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--mn-admin-action, #9E3950);
}
.mn-tile-warn::before  { background: var(--mn-admin-warning, #8A5A12); }
.mn-tile-info::before  { background: #1B6FA8; }
.mn-tile-muted::before { background: transparent; }

.mn-tile-label {
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--mn-admin-text-muted, #574E48);
}
.mn-tile-value {
  font-size: 38px;
  line-height: 1;
  color: var(--mn-admin-text, #1B1613);
  font-variant-numeric: tabular-nums;
}
.mn-tile-context { font-size: 12.5px; color: var(--mn-admin-text-dim, #6E655D); }

.mn-tile.is-zero { background: var(--mn-admin-surface-2, #FDFBF8); }
.mn-tile.is-zero .mn-tile-label,
.mn-tile.is-zero .mn-tile-value,
.mn-tile.is-zero .mn-tile-context { color: var(--mn-admin-text-dim, #A0968C); }

@media (max-width: 1100px) { .mn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .mn-tiles { grid-template-columns: 1fr; } }


/* ── Whose account this is ──────────────────────────────────────────────────
   The creator's name, pinned in the header on every dashboard and admin page.
   It stays put when the sidebar collapses, so a screenshot of any page can be
   traced back to an account without anyone having to ask which one.
   ────────────────────────────────────────────────────────────────────────── */

.header-model {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  padding: 5px 11px;
  border-radius: 100px;
  background: var(--mn-admin-surface-2, #F5EFE8);
  border: 1px solid var(--mn-admin-border, #E8E0D7);
  color: var(--mn-admin-text, #1B1613);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.header-model svg { flex: none; opacity: .55; }
.header-model span { overflow: hidden; text-overflow: ellipsis; }

/* Narrow screens keep the icon as the anchor and drop the name, which would
   otherwise push the account button off the header. */
@media (max-width: 640px) {
  .header-model { max-width: none; padding: 5px 8px; }
  .header-model span { display: none; }
}
