/* ============================================
   DANZFLO Admin Dashboard — Custom Styles
   ============================================ */

/* ---- Base & Typography ---- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #7c3aed;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(37, 99, 235, 0.15);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 40px -12px rgba(15, 23, 42, 0.12);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---- Sidebar ---- */
.sidebar {
  background: #0a0f1a;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 280ms cubic-bezier(0.4, 0, 0.2, 1), transform var(--transition);
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  align-self: flex-start;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar::after {
  content: '';
  position: absolute;
  bottom: 80px;
  right: -80px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Logo header */
.sidebar-header {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all var(--transition);
}

.sidebar-brand:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  height: 4.5rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: all var(--transition);
}

/* Profile card */
.sidebar-profile {
  position: relative;
  z-index: 1;
  margin: 1rem 1rem 0.5rem;
}

.sidebar-profile-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.sidebar-profile-inner:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.sidebar-profile-img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.sidebar-profile-status {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--success);
  border: 2px solid #0a0f1a;
  border-radius: 50%;
}

.sidebar-profile-info {
  min-width: 0;
  flex: 1;
}

.sidebar-profile-name {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-role {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  margin-top: 0.125rem;
  text-transform: lowercase;
}

/* Navigation */
.sidebar-nav {
  position: relative;
  z-index: 1;
  padding: 0.5rem 0.75rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  overflow-anchor: none;
}

.sidebar-nav-list,
.nav-submenu {
  overflow-anchor: none;
}

.sidebar-nav a.nav-item,
.sidebar-nav a.nav-sublink {
  scroll-margin-block: 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.sidebar-nav-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.5rem 0.75rem 0.625rem;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(124, 58, 237, 0.15) 100%);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.nav-item.active .nav-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(124, 58, 237, 0.35));
  color: #ffffff;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition);
}

.nav-item:hover .nav-icon {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Parent items without nav-icon wrapper — style first SVG */
.nav-item--parent > svg:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  padding: 0.375rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition);
}

.nav-item--parent:hover > svg:first-child {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-chevron {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  opacity: 0.4;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-item:hover .nav-chevron {
  opacity: 0.7;
}

.nav-item[aria-expanded="true"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item[aria-expanded="true"] .nav-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(124, 58, 237, 0.3));
  color: #ffffff;
}

.nav-item[aria-expanded="true"] .nav-chevron {
  transform: rotate(90deg);
  opacity: 0.9;
}

/* Submenu */
.nav-submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  margin: 0 0.35rem;
  padding: 0;
  opacity: 0;
  transition:
    max-height 280ms ease,
    opacity 200ms ease,
    margin 200ms ease,
    padding 200ms ease;
}

.nav-submenu.open {
  max-height: 520px;
  margin: 0.25rem 0.35rem 0.5rem;
  padding: 0.35rem;
  opacity: 1;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-submenu li + li {
  margin-top: 0.125rem;
}

.nav-submenu a,
.nav-sublink {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem 0.5rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.nav-submenu a::before,
.nav-sublink::before {
  content: '';
  flex-shrink: 0;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
  transition: all var(--transition);
}

.nav-submenu a:hover,
.nav-sublink:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
}

.nav-submenu a:hover::before,
.nav-sublink:hover::before {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.nav-submenu a.active,
.nav-sublink.active {
  color: #ffffff;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22) 0%, rgba(124, 58, 237, 0.14) 100%);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.nav-submenu a.active::before,
.nav-sublink.active::before {
  background: #38bdf8;
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, 0.18),
    0 0 8px rgba(56, 189, 248, 0.45);
}

/* Sidebar footer */
.sidebar-footer {
  position: relative;
  z-index: 1;
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-collapse-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-collapse-icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--transition);
}

/* Sidebar collapse */
.sidebar.collapsed {
  width: 5.5rem;
}

.sidebar.collapsed .sidebar-brand {
  padding: 0.5rem;
}

.sidebar.collapsed .sidebar-logo {
  height: 2.25rem;
}

.sidebar.collapsed .sidebar-nav-label,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .sidebar-collapse-label {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}

/* Hide profile text completely so flex gap doesn't push avatar off-center */
.sidebar.collapsed .sidebar-profile {
  margin-left: 0.625rem;
  margin-right: 0.625rem;
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .sidebar-profile-info {
  display: none;
}

.sidebar.collapsed .sidebar-profile-inner {
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 0.5rem;
  width: auto;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.sidebar.collapsed .nav-item--parent > svg:first-child,
.sidebar.collapsed .nav-icon {
  margin: 0;
}

.sidebar.collapsed .sidebar-collapse-icon {
  transform: rotate(180deg);
}

/* ---- Header ---- */
.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-search {
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.header-icon-btn {
  color: var(--muted);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.header-icon-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.header-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
}

/* ---- Total Card (in grid) ---- */
.stat-card--total::before {
  background: linear-gradient(90deg, #06b6d4, #2563eb, #7c3aed);
}

.stat-card--total .stat-card-accent {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(37, 99, 235, 0.12));
  color: #2563eb;
}

/* ---- Stat Cards ---- */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card--merch::before {
  background: linear-gradient(90deg, #ec4899, #f472b6);
}

.stat-card--event::before {
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.stat-card--music::before {
  background: linear-gradient(90deg, #d4a574, #c9956a);
}

.stat-card--tv::before {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

.stat-card--social::before {
  background: linear-gradient(90deg, #22c55e, #10b981);
}

.stat-card--classes::before {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}


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

.stat-card-accent {
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card--merch .stat-card-accent {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(244, 114, 182, 0.12));
  color: #ec4899;
}

.stat-card--event .stat-card-accent {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(14, 165, 233, 0.12));
  color: #0ea5e9;
}

.stat-card--music .stat-card-accent {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.15), rgba(201, 149, 106, 0.15));
  color: #b8860b;
}

.stat-card--tv .stat-card-accent {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(168, 85, 247, 0.12));
  color: #7c3aed;
}

.stat-card--social .stat-card-accent {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(16, 185, 129, 0.12));
  color: #16a34a;
}

.stat-card--classes .stat-card-accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(249, 115, 22, 0.12));
  color: #d97706;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.trend-badge--up {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.trend-badge--down {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.trend-badge--neutral {
  color: var(--muted);
  background: rgba(100, 116, 139, 0.1);
}

/* ---- Chart Card ---- */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition);
}

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

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-card-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .chart-card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.chart-card-header--stacked {
  flex-direction: column;
  align-items: flex-start;
}

.chart-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.chart-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-type-badge--line {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.chart-type-badge--bar {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.chart-type-badge--doughnut {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.chart-type-badge--pie {
  background: rgba(236, 72, 153, 0.1);
  color: #db2777;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
}

.chart-canvas-wrap--line {
  height: 340px;
}

.chart-canvas-wrap--bar {
  height: 360px;
}

.chart-canvas-wrap--doughnut,
.chart-canvas-wrap--pie {
  height: 220px;
  width: 220px;
  flex-shrink: 0;
}

.charts-section-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .charts-section-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.charts-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.charts-summary-pill {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.625rem 1rem;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-lg);
  min-width: 140px;
}

.charts-summary-pill--sale {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.12);
}

.charts-summary-pill__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.charts-summary-pill__value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.chart-doughnut-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .chart-doughnut-layout {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0 0.5rem;
  }
}

.chart-canvas-wrap--doughnut,
.chart-canvas-wrap--pie {
  position: relative;
  margin: 0;
}

.chart-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  text-align: center;
}

.chart-center-label__title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chart-center-label__value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0.125rem;
  max-width: 100px;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .chart-center-label__value {
    font-size: 1rem;
    max-width: 120px;
  }
}

.chart-data-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.chart-data-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.chart-data-item:hover {
  background: rgba(37, 99, 235, 0.03);
}

.chart-data-item__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.chart-data-item__module {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.chart-data-item__right {
  text-align: right;
  flex-shrink: 0;
}

.chart-data-item__value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.chart-data-item__pct {
  font-size: 0.6875rem;
  color: var(--muted);
}

.module-data-total-row td {
  border-top: 2px solid var(--border);
  background: rgba(248, 250, 252, 0.8);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.dash-table tfoot td {
  font-size: 0.875rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.25;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: #6d28d9;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg);
  border-color: #cbd5e1;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

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

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

/* ---- Mobile Overlay ---- */
.sidebar-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 50 !important;
    transform: translateX(-100%);
    height: 100vh !important;
    max-height: 100vh !important;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), width 280ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  }
}

@media (min-width: 1025px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    transform: none !important;
  }
}

@media (max-width: 640px) {
  .header-search-wrapper {
    display: none;
  }
}

/* ---- Dashboard Cards ---- */
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

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

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.dash-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.dash-card-action {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

.dash-card-action:hover {
  color: var(--primary-dark);
}

/* ---- Dashboard Table ---- */
.dash-table {
  border-collapse: collapse;
}

.dash-table th {
  padding: 0.75rem 1.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.dash-table td {
  padding: 0.875rem 1.5rem;
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
  white-space: nowrap;
}

.dash-table tbody tr {
  transition: background var(--transition);
}

.dash-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.02);
}

/* ---- Avatars ---- */
.dash-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.dash-avatar--blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.dash-avatar--purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.dash-avatar--amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.dash-avatar--green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.dash-avatar--pink { background: linear-gradient(135deg, #ec4899, #db2777); }

/* ---- Badges ---- */
.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.dash-badge--green { background: rgba(34,197,94,0.1); color: #16a34a; }
.dash-badge--yellow { background: rgba(245,158,11,0.1); color: #d97706; }
.dash-badge--red { background: rgba(239,68,68,0.1); color: #dc2626; }
.dash-badge--blue { background: rgba(37,99,235,0.1); color: #2563eb; }
.dash-badge--pink { background: rgba(236,72,153,0.1); color: #db2777; }
.dash-badge--amber { background: rgba(245,158,11,0.1); color: #b45309; }
.dash-badge--purple { background: rgba(124,58,237,0.1); color: #7c3aed; }
.dash-badge--muted { background: rgba(100,116,139,0.1); color: #64748b; }

/* ---- List Items ---- */
.dash-list {
  padding: 0.5rem 0;
}

.dash-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  transition: background var(--transition);
}

.dash-list-item:hover {
  background: rgba(37, 99, 235, 0.02);
}

.dash-list-item + .dash-list-item {
  border-top: 1px solid var(--border);
}

/* ---- Thumbnails ---- */
.dash-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-thumb--blue { background: rgba(37,99,235,0.1); color: #2563eb; }
.dash-thumb--pink { background: rgba(236,72,153,0.1); color: #ec4899; }
.dash-thumb--amber { background: rgba(245,158,11,0.1); color: #d97706; }
.dash-thumb--green { background: rgba(34,197,94,0.1); color: #16a34a; }
.dash-thumb--purple { background: rgba(124,58,237,0.1); color: #7c3aed; }

/* ---- Activity Feed ---- */
.dash-activity-list {
  padding: 0.75rem 1.5rem;
}

.dash-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0;
}

.dash-activity-item + .dash-activity-item {
  border-top: 1px solid var(--border);
}

.dash-activity-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.375rem;
}

.dash-activity-dot--green { background: #22c55e; }
.dash-activity-dot--blue { background: #2563eb; }
.dash-activity-dot--pink { background: #ec4899; }
.dash-activity-dot--amber { background: #f59e0b; }
.dash-activity-dot--purple { background: #7c3aed; }

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Admin loader (inline + optional fullscreen)
   ============================================ */
.admin-loader-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  width: 100%;
}

.admin-loader-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.75);
}

.admin-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.admin-loader-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: adminLoaderSpin 0.7s linear infinite;
}

.admin-loader-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

@keyframes adminLoaderSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Table refresh (pagination) — keep rows visible, centered loader */
.users-table-wrap--busy {
  position: relative;
}

.users-table-wrap--initial {
  min-height: 280px;
}

.users-table-wrap--busy .users-table-inner {
  opacity: 0.45;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.users-table-busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* Hide number input spin buttons; users type values manually */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
