:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 78px;
  --header-height: 64px;
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: rgba(79, 70, 229, 0.15);
  --sidebar-active-border: #6366f1;
  --body-bg: #f8fafc;
  --card-border: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--body-bg);
  color: #1e293b;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout Wrapper */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1040;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
}

.sidebar-nav-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sidebar-nav-heading {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.sidebar-link:hover {
  color: var(--sidebar-text-hover);
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link:hover i {
  color: #ffffff;
}

.sidebar-link.active {
  color: #ffffff;
  background-color: var(--sidebar-active-bg);
  border-left: 3px solid var(--sidebar-active-border);
  font-weight: 600;
}

.sidebar-link.active i {
  color: #818cf8;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.04);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Main Content Area */
.admin-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: calc(100% - var(--sidebar-width));
}

/* Top Header Navbar */
.admin-header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-toggle-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: #64748b;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-toggle-btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

/* Content Container */
.admin-content {
  padding: 1.75rem 1.5rem;
  flex-grow: 1;
}

/* Stat Cards */
.stat-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #ffffff;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Table Enhancements */
.admin-table {
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table thead th {
  background-color: #f8fafc;
  border-bottom: 2px solid var(--card-border);
  font-weight: 600;
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 0.85rem 1rem;
}

.admin-table tbody td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.925rem;
}

/* Backdrop for mobile drawer */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1030;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* Login Page Styling */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.login-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
}
