:root {
  --admin-bg: #0C0D0F;
  --admin-sidebar: #14161A;
  --admin-card: #1A1D23;
  --admin-card-border: #2B2F38;
  --admin-text: #F1F1EF;
  --admin-muted: #8E96A4;
  --admin-accent: #2F6FE4;
  --admin-accent-hover: #1F55BE;
  --admin-accent-lt: #7FB0FF;
  --admin-success: #28A745;
  --admin-warning: #FFC107;
  --admin-danger: #DC3545;
  --admin-font: "Archivo", system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--admin-font);
  background: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Auth / Login Screen */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, #17243b 0%, #0c0d0f 70%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.auth-logo {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-logo b {
  color: var(--admin-accent-lt);
}

.auth-desc {
  text-align: center;
  color: var(--admin-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.3rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #B5BDC9;
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: #111317;
  border: 1px solid var(--admin-card-border);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--admin-accent-lt);
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

.btn-primary {
  width: 100%;
  background: var(--admin-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--admin-accent-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--admin-card-border);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.btn-danger {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b7b;
  border: 1px solid rgba(220, 53, 69, 0.4);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(220, 53, 69, 0.35);
}

/* Admin App Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  border-right: 1px solid var(--admin-card-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-x: hidden !important;
}

.sidebar-header {
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--admin-card-border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--admin-text);
  text-decoration: none;
}
.sidebar-logo b { color: var(--admin-accent-lt); }

.sidebar-badge {
  display: inline-block;
  background: rgba(47, 111, 228, 0.2);
  color: var(--admin-accent-lt);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.95rem;
  color: var(--admin-muted);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

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

.nav-item.active {
  color: #fff;
  background: var(--admin-accent);
}

.sidebar-footer {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--admin-card-border);
  background: var(--admin-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.user-role,
.user-role a,
#currentUserEmail,
#currentUserEmail a {
  font-size: 0.78rem !important;
  color: var(--admin-muted) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  line-height: 1.3;
  text-decoration: none !important;
  display: block;
}

.btn-logout {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.25);
  color: #FF6B7B;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: rgba(220, 53, 69, 0.2);
  border-color: #DC3545;
  color: #FFFFFF;
}

:root[data-admin-theme="light"] .btn-logout {
  background: #FFF1F2;
  border-color: #FECDD3;
  color: #E11D48;
}

:root[data-admin-theme="light"] .btn-logout:hover {
  background: #FFE4E6;
  border-color: #FDA4AF;
  color: #BE123C;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  padding: 2rem 2.5rem 4rem;
  background: var(--admin-bg);
}

/* Desktop Only (>=861px): Pin sidebar to 100vh with internal scroll so footer/logout is always visible */
@media (min-width: 861px) {
  .admin-layout {
    height: 100vh;
    overflow: hidden;
  }

  .sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
  }

  .sidebar-nav {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-main {
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.top-actions {
  display: flex;
  gap: 0.8rem;
}

/* Cards & Grid */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.8rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--admin-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-2 {
  display: grid;
  gap: 1.2rem;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-3 {
  display: grid;
  gap: 1.2rem;
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.stat-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--admin-accent-lt);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--admin-muted);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

th {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  color: var(--admin-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--admin-card-border);
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--admin-card-border);
  color: #fff;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-paid { background: rgba(40, 167, 69, 0.2); color: #48d968; }
.badge-pending { background: rgba(255, 193, 7, 0.2); color: #ffce3b; }
.badge-super { background: rgba(127, 176, 255, 0.2); color: #7FB0FF; }

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e7e34;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: none;
  z-index: 100;
  animation: slideIn 0.3s ease;
}

.toast.error {
  background: #dc3545;
}

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

/* Interactive Tap-To-Toggle Pills for Availability & Settings */
.admin-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
}

.admin-tap-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  color: var(--admin-muted);
  font: 600 0.92rem var(--admin-font);
  cursor: pointer;
  user-select: none;
  min-height: 42px;
  transition: all 0.15s ease;
}

.admin-tap-pill:hover {
  border-color: var(--admin-accent);
  color: var(--admin-text);
  transform: translateY(-1px);
}

.admin-tap-pill.is-active {
  background: var(--admin-accent) !important;
  border-color: var(--admin-accent) !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(47, 111, 228, 0.35);
}

.admin-tap-pill.is-active::after {
  content: " ✓";
  font-size: 0.82rem;
  opacity: 0.9;
}

.pill-quick-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.pill-action-btn {
  background: transparent;
  border: 1px solid var(--admin-card-border);
  color: var(--admin-accent-lt);
  font: 600 0.8rem var(--admin-font);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-action-btn:hover {
  background: rgba(47, 111, 228, 0.15);
  border-color: var(--admin-accent);
  color: #FFFFFF;
}

/* Mobile Responsive Admin Styles */
@media (max-width: 860px) {
  .admin-layout {
    display: flex;
    flex-direction: column;
    height: auto !important;
    min-height: 100vh;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .sidebar {
    width: 100% !important;
    height: auto !important;
    position: sticky;
    top: 0;
    z-index: 45;
    overflow: visible !important;
    background: var(--admin-sidebar);
    border-right: none;
    border-bottom: 1px solid var(--admin-card-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  }

  .sidebar-header {
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar-footer {
    display: none;
  }

  #mobileLogoutBtn {
    display: inline-block !important;
  }

  #mobileHeaderMenuBtn {
    display: inline-flex !important;
  }

  /* Hide the desktop tab pills completely on mobile — navigation is handled via the sleek Admin Menu drawer */
  .sidebar-nav {
    display: none !important;
  }

  .admin-main {
    height: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 1rem 0.8rem 6rem !important;
  }

  .top-bar {
    margin-bottom: 1.2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .top-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  .top-actions a,
  .top-actions #saveAllBtn {
    display: none !important;
  }

  #adminMenuToggleBtn,
  #adminTopThemeBtn {
    display: inline-flex !important;
    padding: 0.5rem 0.85rem !important;
    font-size: 0.85rem !important;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .admin-card {
    padding: 1.2rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
  }

  .form-input {
    font-size: 1rem;
    min-height: 46px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
  }

  .admin-table {
    min-width: 580px;
  }

  .admin-tap-pill {
    padding: 0.6rem 0.95rem;
    font-size: 0.88rem;
    min-height: 42px;
  }

  .mobile-save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 22, 26, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--admin-card-border);
    padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.4);
  }

  .mobile-save-bar .btn-primary {
    width: 100%;
    min-height: 48px;
    font-size: 1.05rem;
    border-radius: 8px;
  }
}

@media (min-width: 861px) {
  .mobile-save-bar {
    display: none !important;
  }
}

/* ==========================================================================
   ADMIN LIGHT THEME
   ========================================================================== */
:root[data-admin-theme="light"] {
  --admin-bg: #F5F7FA;
  --admin-sidebar: #FFFFFF;
  --admin-card: #FFFFFF;
  --admin-card-border: #D8DFE8;
  --admin-text: #11141A;
  --admin-muted: #536074;
  --admin-accent: #1D54E2;
  --admin-accent-hover: #143FAF;
  --admin-accent-lt: #1D54E2;
}

:root[data-admin-theme="light"] body {
  background: var(--admin-bg);
  color: var(--admin-text);
}

:root[data-admin-theme="light"] .sidebar {
  background: var(--admin-sidebar);
  border-right-color: var(--admin-card-border);
}

:root[data-admin-theme="light"] .sidebar-logo {
  color: #11141A;
}

:root[data-admin-theme="light"] .sidebar-nav .nav-item {
  color: #475569;
}

:root[data-admin-theme="light"] .sidebar-nav .nav-item:hover {
  background: #F1F5F9;
  color: #0F172A;
}

:root[data-admin-theme="light"] .sidebar-nav .nav-item.active {
  background: #EEF2FF;
  color: var(--admin-accent);
  border-color: #C7D2FE;
  font-weight: 700;
}

:root[data-admin-theme="light"] .form-input,
:root[data-admin-theme="light"] .form-textarea,
:root[data-admin-theme="light"] select.form-input {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #11141A;
}

:root[data-admin-theme="light"] .form-input:focus,
:root[data-admin-theme="light"] .form-textarea:focus,
:root[data-admin-theme="light"] select.form-input:focus {
  border-color: var(--admin-accent);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(29, 84, 226, 0.12);
}

:root[data-admin-theme="light"] .btn-secondary {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #1E293B;
}

:root[data-admin-theme="light"] .btn-secondary:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  color: #0F172A;
}

:root[data-admin-theme="light"] .admin-tap-pill {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #334155;
}

:root[data-admin-theme="light"] .admin-tap-pill:hover {
  border-color: #94A3B8;
  color: #0F172A;
}

:root[data-admin-theme="light"] .admin-tap-pill.is-active {
  background: var(--admin-accent);
  border-color: var(--admin-accent);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(29, 84, 226, 0.3);
}

:root[data-admin-theme="light"] .stat-card {
  background: #FFFFFF;
  border-color: var(--admin-card-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

:root[data-admin-theme="light"] .stat-label {
  color: var(--admin-muted);
}

:root[data-admin-theme="light"] .stat-num {
  color: #11141A;
}

:root[data-admin-theme="light"] .table-wrap table th {
  background: #F8FAFC;
  color: #475569;
  border-bottom-color: #E2E8F0;
}

:root[data-admin-theme="light"] .table-wrap table td {
  border-bottom-color: #F1F5F9;
  color: #1E293B;
}

:root[data-admin-theme="light"] .table-wrap table tr:hover td {
  background: #F8FAFC;
}

:root[data-admin-theme="light"] .mobile-save-bar {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: #D8DFE8;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   DESKTOP VS MOBILE HEADER RULES
   ========================================================================== */
@media (min-width: 861px) {
  #adminMenuToggleBtn {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .top-actions {
    display: flex !important;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
  }
  .top-actions a,
  .top-actions #saveAllBtn {
    display: none !important;
  }
  #adminMenuToggleBtn,
  #adminTopThemeBtn {
    display: inline-flex !important;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }
}

/* Theme Toggle Button & SVG Icon Alignment */
#adminTopThemeBtn,
#overviewThemeToggleBtn,
#drawerThemeToggleBtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.55rem !important;
  cursor: pointer;
  white-space: nowrap !important;
}

.theme-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}

.theme-icon svg {
  display: block;
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   OVERVIEW MANAGEMENT HUB GRID
   ========================================================================== */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-bottom: 2rem;
}

@media (max-width: 1100px) {
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.overview-hub-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  border-radius: 8px;
  padding: 1.35rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.overview-hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--admin-accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

:root[data-admin-theme="light"] .overview-hub-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

:root[data-admin-theme="light"] .overview-hub-card:hover {
  border-color: var(--admin-accent);
  box-shadow: 0 6px 18px rgba(29, 84, 226, 0.1);
}

.overview-hub-card .hub-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(47, 111, 228, 0.12);
  color: var(--admin-accent-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.overview-hub-card:hover .hub-icon {
  background: var(--admin-accent);
  color: #FFFFFF;
}

.overview-hub-card .hub-content {
  flex: 1;
}

.overview-hub-card .hub-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--admin-text);
  margin-bottom: 0.3rem;
}

.overview-hub-card .hub-content p {
  font-size: 0.85rem;
  color: var(--admin-muted);
  line-height: 1.45;
}

.overview-hub-card .hub-arrow {
  color: var(--admin-muted);
  font-size: 1.1rem;
  align-self: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.overview-hub-card:hover .hub-arrow {
  color: var(--admin-accent);
  transform: translateX(3px);
}

/* ==========================================================================
   ADMIN SLIDE-IN MENU DRAWER
   ========================================================================== */
.admin-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.admin-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.admin-menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: var(--admin-sidebar);
  border-left: 1px solid var(--admin-card-border);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-menu-drawer.open {
  transform: translateX(0);
}

.admin-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--admin-card-border);
}

.admin-drawer-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--admin-text);
}

.admin-drawer-sub {
  font-size: 0.8rem;
  color: var(--admin-muted);
}

.admin-drawer-close {
  background: transparent;
  border: 1px solid var(--admin-card-border);
  color: var(--admin-text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.admin-drawer-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-admin-theme="light"] .admin-drawer-close:hover {
  background: #F1F5F9;
}

.admin-drawer-theme {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--admin-card-border);
}

.admin-drawer-theme-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--admin-card);
  border: 1px solid var(--admin-card-border);
  border-radius: 8px;
  color: var(--admin-text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-drawer-theme-btn:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.admin-drawer-section-label {
  padding: 1.2rem 1.4rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--admin-muted);
}

.admin-drawer-nav {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.admin-drawer-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--admin-text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.admin-drawer-link .drawer-arrow {
  color: var(--admin-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.admin-drawer-link:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(3px);
}

:root[data-admin-theme="light"] .admin-drawer-link:hover {
  background: #F1F5F9;
}

.admin-drawer-link.active {
  background: var(--admin-card);
  border-color: var(--admin-card-border);
  color: var(--admin-accent);
}

:root[data-admin-theme="light"] .admin-drawer-link.active {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: var(--admin-accent);
}

.admin-drawer-link.active .drawer-arrow {
  color: var(--admin-accent);
  transform: translateX(2px);
}

.admin-drawer-footer {
  padding: 1rem 1.4rem 1.8rem;
  border-top: 1px solid var(--admin-card-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-drawer-external,
.admin-drawer-logout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}

.admin-drawer-external {
  background: transparent;
  border: 1px solid var(--admin-card-border);
  color: var(--admin-text);
}

.admin-drawer-external:hover {
  border-color: var(--admin-muted);
}

.admin-drawer-logout {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #FF6B7B;
}

.admin-drawer-logout:hover {
  background: rgba(220, 53, 69, 0.2);
}
