:root {
  --bg-primary: #0D1117;
  --bg-secondary: #1A1A2E;
  --bg-card: #161B27;
  --bg-card-hover: #1E2535;
  --purple-primary: #7C3AED;
  --purple-light: #9D5CF6;
  --purple-glow: rgba(124, 58, 237, 0.25);
  --teal: #06B6D4;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --deep-purple: #2D1B69;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border: rgba(255, 255, 255, 0.06);
  --border-purple: rgba(124, 58, 237, 0.3);
  --sidebar-width: 240px;
  --topbar-height: 64px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 400;
}

a {
  text-decoration: none;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

.fw-semibold-custom {
  font-weight: 600;
}

.text-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

#concert-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #0D1117 0%, #1A1A2E 50%, #2D1B69 100%);
  transition: opacity 0.8s ease;
}

body.has-event-bg #concert-bg {
  filter: blur(3px) brightness(0.3);
}

body.has-event-bg #concert-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,17,23,0.7) 0%, rgba(13,17,23,0.92) 60%, #0D1117 100%);
}

/* Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--border-purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
  font-size: 16px;
}

.trend-badge {
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.trend-badge.positive {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

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

/* Buttons */
.btn-primary-custom {
  background: linear-gradient(135deg, #7C3AED, #9D5CF6);
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  transition: all 0.3s ease;
}

.btn-primary-custom:hover {
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary-custom {
  background: rgba(124, 58, 237, 0.12);
  color: #A78BFA;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-secondary-custom:hover {
  background: rgba(124, 58, 237, 0.2);
  color: #A78BFA;
}

.btn-success-custom {
  background: linear-gradient(135deg, #059669, #10B981);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Inputs */
.input-icon-group {
  position: relative;
}

.input-icon-group .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.form-control-custom {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 12px 16px;
  width: 100%;
}

.form-control-custom.with-icon {
  padding-left: 44px;
}

.form-control-custom::placeholder {
  color: var(--text-muted);
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

select.form-control-custom {
  appearance: none;
}

/* Badges */
.badge-custom {
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.badge-live, .badge-active, .badge-paid {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-draft {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}

.badge-past, .badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-failed, .badge-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.badge-vip {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-vvip {
  background: rgba(124, 58, 237, 0.15);
  color: #A78BFA;
}

/* Progress bars */
.progress-track {
  background: rgba(255, 255, 255, 0.06);
  height: 6px;
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-custom {
  height: 100%;
  background: linear-gradient(90deg, #7C3AED, #06B6D4);
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* Avatar */
.avatar-circle {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 40px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Loading spinner */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.sidebar-logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.sidebar-section-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  padding: 16px 20px 8px;
}

.sidebar-nav {
  padding: 0 12px;
}

.nav-item-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.nav-item-custom i {
  width: 18px;
  text-align: center;
}

.nav-item-custom:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item-custom.active {
  background: rgba(124, 58, 237, 0.15);
  color: #A78BFA;
  border-left: 3px solid var(--purple-primary);
  font-weight: 600;
}

.sidebar-user {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-user .user-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.sidebar-user .logout-link {
  margin-left: auto;
  color: var(--text-muted);
}

.sidebar-user .logout-link:hover {
  color: var(--danger);
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 900;
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-bell {
  color: var(--text-secondary);
  font-size: 18px;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
}

/* Content area */
.admin-content {
  margin-left: var(--sidebar-width);
  padding: 88px 24px 24px 24px;
  background: var(--bg-primary);
  min-height: 100vh;
}

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

::-webkit-scrollbar-track {
  background: #0D1117;
}

::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.4);
  border-radius: 100px;
}

/* Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .topbar {
    left: 0;
  }

  .admin-content {
    margin-left: 0;
    padding: 88px 16px 16px 16px;
  }

  .sidebar-toggle {
    display: inline-block;
  }
}

/* ============================================================
   Global mobile hygiene — prevents pages from bleeding sideways
   on phone viewports regardless of specific layout inside.
   ============================================================ */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .container, .container-fluid {
    padding-left: 16px;
    padding-right: 16px;
  }
  .py-5 {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }
}
