:root {
  --bg-primary: hsl(240, 15%, 8%);
  --bg-secondary: hsl(240, 15%, 12%);
  --bg-tertiary: hsl(240, 12%, 16%);
  --accent-purple: hsl(263, 90%, 65%);
  --accent-blue: hsl(217, 91%, 60%);
  --accent-gradient: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  
  --text-main: hsl(0, 0%, 96%);
  --text-muted: hsl(240, 8%, 70%);
  --border-color: hsl(240, 10%, 18%);
  --border-glow: hsla(263, 90%, 65%, 0.15);
  
  --success: hsl(142, 72%, 45%);
  --warning: hsl(38, 92%, 50%);
  --danger: hsl(0, 84%, 60%);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.8);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* General Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.text-success { color: var(--success); }
.text-purple { color: var(--accent-purple); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.code-font { font-family: 'Courier New', Courier, monospace; font-weight: 700; }
.border-top { border-top: 1px solid var(--border-color); }
.pt-16 { padding-top: 16px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.w-full { width: 100%; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 12px hsla(263, 90%, 65%, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px hsla(263, 90%, 65%, 0.45);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Access Denied Card */
.access-denied-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 50%, hsla(263, 90%, 65%, 0.08) 0%, transparent 60%);
}

.denied-card {
  background: rgba(22, 22, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 48px;
  border-radius: 20px;
  text-align: center;
  max-width: 460px;
  box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.lock-icon {
  color: var(--danger);
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 10px rgba(239, 68, 68, 0.2));
}

.denied-card h2 {
  font-size: 24px;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.denied-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
}

/* Main Layout Grid */
.admin-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar styling */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 800;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  text-align: left;
  background-color: transparent;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px hsla(263, 90%, 65%, 0.2);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-purple);
  object-fit: cover;
}

#admin-name {
  font-weight: 600;
  font-size: 14px;
}

/* Workspace main content */
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-header {
  padding: 24px 40px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-secondary);
}

.workspace-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.date-badge {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Panels */
.admin-panel {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: radial-gradient(circle at 90% 10%, hsla(217, 91%, 60%, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 10% 90%, hsla(263, 90%, 65%, 0.03) 0%, transparent 50%);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.stat-card {
  background: rgba(22, 22, 26, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.12);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-val {
  font-size: 28px;
  font-weight: 800;
}

.status-summary-card {
  background-color: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  padding: 20px;
  font-size: 14px;
  color: var(--success);
  margin-top: 16px;
}

/* Grids */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel-card {
  background: rgba(22, 22, 26, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 32px;
  align-self: start;
  box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.panel-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.max-width-600 {
  max-width: 600px;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group textarea {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  color: white;
  outline: none;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px var(--border-glow);
}

.form-group textarea {
  height: 120px;
  resize: vertical;
}

/* Modern Form Control (Inputs & Selects) */
.form-control {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px var(--border-glow);
}

.form-control::placeholder {
  color: #6b7280;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

.select-wrapper {
  position: relative;
  display: inline-block;
}

.filters-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.input-with-action input {
  flex: 1;
}

.helper-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tables */
.table-wrapper {
  border-radius: 10px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--bg-secondary);
}

.scrollable-table {
  max-height: 420px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-tertiary);
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 5;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  transition: var(--transition-smooth);
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

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

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

.badge-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* User Summary in adjustments */
.user-details-summary {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 8, 16, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: rgba(17, 17, 27, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-close-modal:hover {
  color: white;
}

.modal-body {
  padding: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #btn-toggle-sidebar {
    display: inline-flex !important;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.5);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .workspace-header {
    padding: 16px 20px;
  }
  
  .workspace-header h2 {
    font-size: 16px;
  }
  
  .date-badge {
    display: none;
  }
  
  .admin-panel {
    padding: 16px 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-val {
    font-size: 20px;
  }
  
  .panel-card {
    padding: 20px;
  }
  
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .data-table th, .data-table td {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filters-row input, .filters-row select, .filters-row .select-wrapper {
    width: 100% !important;
  }
}

/* Custom Premium Alert & Confirm Modals */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 8, 16, 0.45);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.custom-modal-overlay.active {
  opacity: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}

.custom-modal-box {
  background: rgba(17, 17, 27, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  width: 90%;
  max-width: 440px;
  padding: 24px;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f3f4f6;
  font-family: 'Outfit', sans-serif;
}

.custom-modal-overlay.active .custom-modal-box {
  transform: translateY(0) scale(1);
}

.custom-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-modal-header h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.custom-modal-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.custom-modal-icon-wrapper.text-gradient-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.custom-modal-body {
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #9ca3af;
}

.custom-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.custom-modal-footer button {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-modal-footer .btn-modal-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #d1d5db;
}

.custom-modal-footer .btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
