:root {
  --bg-dark: #070913;
  --bg-card: #101426;
  --bg-card-hover: #161b33;
  --bg-card-header: #141930;
  --sidebar-bg: #0c0f1f;
  --gold-primary: #FFD700;
  --gold-bright: #FFE57F;
  --gold-dark: #B8860B;
  --gold-glow: rgba(255, 215, 0, 0.25);
  --cyan-accent: #00E5FF;
  --purple-accent: #9C27B0;
  --emerald: #00E676;
  --ruby: #FF1744;
  --text-main: #FFFFFF;
  --text-muted: #8E99B7;
  --text-sub: #BAC4E2;
  --border-color: rgba(255, 215, 0, 0.15);
  --border-glow: rgba(255, 215, 0, 0.35);
  --sidebar-width: 260px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(30, 40, 80, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(80, 40, 10, 0.2) 0%, transparent 40%);
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFD700 0%, #E65100 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  padding: 12px 14px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 215, 0, 0.08);
  color: #FFFFFF;
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%);
  color: var(--gold-bright);
  border-left: 3px solid var(--gold-primary);
  font-weight: 700;
}

.nav-link-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C4DFF, #1E88E5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.admin-info {
  line-height: 1.2;
}

.admin-name {
  font-size: 13px;
  font-weight: 700;
}

.admin-role {
  font-size: 11px;
  color: var(--gold-primary);
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255, 23, 68, 0.3);
  color: #FF5252;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255, 23, 68, 0.15);
  border-color: #FF5252;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

.admin-topbar {
  padding: 18px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(10px);
}

.page-title-group h1 {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
}

.page-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.content-container {
  padding: 32px;
  flex: 1;
}

/* Dashboard Cards Grid */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.gold {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.stat-icon.cyan {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan-accent);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.stat-icon.emerald {
  background: rgba(0, 230, 118, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.stat-icon.purple {
  background: rgba(156, 39, 176, 0.15);
  color: #CE93D8;
  border: 1px solid rgba(156, 39, 176, 0.3);
}

.stat-details .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
}

.stat-details .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Section */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

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

.card-header h2 {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h2 span {
  font-size: 20px;
}

.card-body {
  padding: 24px;
}

/* Form Controls */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

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

.form-control {
  background: #0a0d1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: #FFFFFF;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
  background: #0f1326;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Switches & Toggles */
.toggle-switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #0a0d1a;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.toggle-switch-info {
  line-height: 1.3;
}

.toggle-switch-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.toggle-switch-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #2a3048;
  transition: .3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background: linear-gradient(90deg, #00C853, #00E676);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  color: #070913;
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FFE082 0%, #FFB300 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 215, 0, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(255, 23, 68, 0.15);
  color: #FF5252;
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 23, 68, 0.25);
  border-color: #FF5252;
}

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

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 16px 18px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 215, 0, 0.03);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-gold {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.badge-green {
  background: rgba(0, 230, 118, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.badge-red {
  background: rgba(255, 23, 68, 0.15);
  color: var(--ruby);
  border: 1px solid rgba(255, 23, 68, 0.35);
}

.badge-cyan {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan-accent);
  border: 1px solid rgba(0, 229, 255, 0.35);
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #141930;
  border: 1px solid var(--gold-primary);
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  animation: slideInRight 0.3s ease;
}

.toast.success {
  border-color: var(--emerald);
}

.toast.error {
  border-color: var(--ruby);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Login Page Specifics */
.login-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1.5px solid var(--gold-primary);
  border-radius: 20px;
  padding: 36px 30px;
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.8),
    0 0 24px rgba(255, 215, 0, 0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header .brand-icon {
  margin: 0 auto 16px;
  width: 56px;
  height: 56px;
  font-size: 28px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
}

.login-header p {
  font-size: 13px;
  color: var(--gold-primary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1.5px solid var(--gold-primary);
  border-radius: 18px;
  width: 90%;
  max-width: 560px;
  overflow: hidden;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.8);
  animation: zoomIn 0.2s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
}

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

.modal-close:hover {
  color: #FFFFFF;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Responsive */
@media (max-width: 900px) {
  body {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .content-container {
    padding: 20px 16px;
  }
}
