:root {
  /* Color Palette - Deep Water & Midnight Sky */
  --primary: #0ea5e9;
  --primary-glow: rgba(14, 165, 233, 0.4);
  --secondary: #6366f1;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #f43f5e;

  /* Backgrounds */
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --card-bg: rgba(30, 41, 59, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Shadows & Radius */
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

.admin-only {
  display: none !important;
}

body.is-admin .admin-only {
  display: block !important;
}

body.is-admin .stat-card.admin-only {
  display: flex !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.15) 0px, transparent 50%);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-sidebar);
  border-radius: 10px;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  z-index: 100;
  transition: all 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--primary);
}

.brand i {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-menu {
  list-style: none;
  flex: 1;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.nav-link i {
  font-size: 1.25rem;
  width: 24px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.header-title h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title p {
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
}

.stat-info {
  width: 100%;
}

.stat-info .label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-info .value {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 700;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Form Styling */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-control {
  width: 100%;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  background: var(--bg-sidebar);
  width: 100%;
  max-width: 800px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 2rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 1.25rem 1rem;
  border-bottom: 2px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

.table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Labels & Badges */
.label {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
}

/* Premium User Management Redesign */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.member-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.member-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.member-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-8px);
  border-color: rgba(var(--primary-rgb), 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.member-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.member-avatar-wrapper {
  position: relative;
}

.member-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  border: 3px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.status-pulse {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 14px;
  height: 14px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

.status-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.member-details h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.role-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.role-badge.admin {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent);
}

.member-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
}

.action-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.action-btn.delete:hover {
  background: var(--danger);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}

/* Activity Selection Grid */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.activity-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(10px);
}

.activity-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.activity-card i {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.activity-card span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Mobile Header */
.mobile-header {
  display: none;
  background: var(--bg-sidebar);
  padding: 1rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--glass-border);
}

.mobile-header .brand {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.menu-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsiveness Media Queries */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    bottom: 0;
    width: 280px;
    z-index: 250;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
  }

  .sidebar.active {
    left: 0;
  }

  .main-content {
    padding: 1.5rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .header-actions {
    width: 100%;
  }

  /* Grid Adjustments */
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .activity-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
  }

  .user-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }

  .header-title h1 {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .activity-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .glass-card {
    padding: 1.5rem;
  }

  /* Dashboard Grid Stack */
  #view-dashboard>div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .modal-content {
    padding: 1.5rem;
    width: 95%;
  }

  .form-group label {
    font-size: 0.8rem;
  }

  .input-control {
    padding: 0.75rem;
  }

  .btn {
    padding: 0.65rem 1rem;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .header-actions #ticketIDDisplay {
    width: 100%;
    justify-content: space-between;
    display: flex;
  }
}

/* Animation */
@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-up {
  animation: slideInUp 0.4s ease forwards;
}

/* Login Page Specific */
.login-view {
  background: url('login-bg.png') center/cover no-repeat;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.login-glass {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  padding: 4rem 3rem;
  border-radius: 40px;
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.login-logo {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.login-glass h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}


/* Global Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}