/* Admin dashboard styles extracted from provided template and adapted to dark Rims theme */

/* Brand Folder Structure Styles */
.brand-folders-container {
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-folder {
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.brand-folder:hover {
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.folder-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  user-select: none;
}

.folder-header:hover {
  background: rgba(255, 215, 0, 0.1);
}

.folder-header .folder-icon {
  font-size: 1.2rem;
  margin-right: 12px;
  color: #ffd700;
  transition: transform 0.3s ease;
}

.folder-header.expanded .folder-icon {
  transform: rotate(90deg);
}

.folder-header .folder-name {
  flex: 1;
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
}

.folder-header .folder-count {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.folder-content {
  display: none;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.folder-content.expanded {
  display: block;
}

.tire-folder {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tire-folder:last-child {
  border-bottom: none;
}

.tire-folder .folder-header {
  background: rgba(255, 255, 255, 0.03);
  padding-left: 40px;
  font-size: 0.9rem;
}

.tire-folder .folder-header:hover {
  background: rgba(255, 215, 0, 0.05);
}

.tire-folder .folder-icon {
  font-size: 1rem;
  color: #ffed4e;
}

.tire-folder .folder-details {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  margin-right: 8px;
}

.products-list {
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
}

.product-item {
  padding: 12px 16px 12px 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-item:hover {
  background: rgba(255, 215, 0, 0.05);
}

.product-item:last-child {
  border-bottom: none;
}

.product-info {
  flex: 1;
}

.product-code {
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
}

.product-specs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.spec-item {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.product-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator.new {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}

.no-products {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 40px;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .brand-folders-container {
    margin: 10px 0;
    padding: 15px;
  }
  
  .folder-header {
    padding: 10px 12px;
  }
  
  .tire-folder .folder-header {
    padding-left: 30px;
  }
  
  .product-item {
    padding: 10px 12px 10px 45px;
  }
  
  .product-specs {
    gap: 8px;
  }
  
  .spec-item {
    font-size: 0.7rem;
  }
}

/* Centered form layout for banner form */
.admin-left-column.centered-form {
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

/* Upload button styling */
.input-with-upload {
  display: flex !important;
  gap: 8px !important;
}

.upload-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%) !important;
  color: #000 !important;
  border: none !important;
  padding: 10px 12px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 44px !important;
}

.upload-btn:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3) !important;
}

.upload-btn i {
  font-size: 1.1rem !important;
}

/* Full width layout for product form */
.admin-left-column.full-width {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
  padding: 0 40px !important;
  margin: 0 auto !important;
}

/* Improved delete button styling */
.btn-delete {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  color: #fff !important;
  border: none !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.btn-delete:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
}

.btn-delete:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3) !important;
}

.btn-delete i {
  font-size: 1rem !important;
}

/* Improved navbar styling */
header.site-header .site-nav {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px !important;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 32px !important;
}

header.site-header .site-nav ul {
  display: flex !important;
  gap: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
}

header.site-header .site-nav ul li a {
  color: var(--admin-text) !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 1.2rem !important;
  transition: color 0.3s ease !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
}

header.site-header .site-nav ul li a:hover {
  color: var(--admin-accent) !important;
  background: rgba(255, 215, 0, 0.1) !important;
  transform: translateY(-2px) !important;
}

/* Test styles to verify CSS is loading */
body.admin-page {
  background: #000 !important;
  color: #fff !important;
}

/* Test sidebar visibility */
#sidebar {
  background: #000 !important;
  border: 1px solid #333 !important;
}

/* Test header */
.admin-unified-header {
  background: #0000ff !important;
  border: 3px solid #ffff00 !important;
}

/* Test content area */
#content {
  background: #000 !important;
  border: 1px solid #333 !important;
}

:root {
  --admin-bg: #000;
  --admin-surface: #111;
  --admin-surface-alt: #181818;
  --admin-border: #222;
  --admin-accent: #ffd700;
  --admin-text: #fff;
  --admin-muted: #aaaaaa;
}

body.admin-page {
  background: var(--admin-bg);
}

/* Keep admin top navbar horizontal in all viewports */
/* Admin Navigation Bar - Fixed Width Layout */
body.admin-page .site-header {
  position: relative;
  z-index: 1000;
  background: var(--admin-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 0 20px; /* Admin Navigation Bar - Fixed at Bottom */
}

body.admin-page .site-header .site-nav {
  display: grid !important;
  grid-template-columns: auto 1fr auto; /* Logo | Navigation | User Menu */
  align-items: center;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 0;
  height: 56px;
  position: sticky;
  bottom: 0; /* Fixed at bottom */
  top: auto; /* Removed top positioning */
  z-index: 1000;
}

/* Logo */
body.admin-page .site-header .logo {
  font-size: 1.5rem;
  font-weight: bold;
  min-width: 100px;
  text-align: center;
}

/* Navigation links container */
body.admin-page .site-header .nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Navigation buttons */
body.admin-page .site-header .nav-btn {
  color: var(--admin-text);
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

body.admin-page .site-header .nav-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

body.admin-page .site-header .nav-btn:active {
  transform: translateY(0);
  background: rgba(255, 215, 0, 0.25);
  border-color: rgba(255, 215, 0, 0.4);
}

/* Main Navigation */
body.admin-page .site-header .site-nav > ul {
  display: flex !important;
  justify-content: center;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.admin-page .site-header .site-nav > ul li {
  min-width: 60px;
  text-align: center;
}

body.admin-page .site-header .site-nav > ul li a {
  display: block;
  padding: 6px 8px;
  white-space: nowrap;
  transition: color 0.2s;
  font-size: 0.9rem;
}

/* User Options */
body.admin-page .site-header .user-options {
  display: flex !important;
  justify-content: flex-end;
  gap: 15px;
  min-width: 200px;
}

/* Menu Toggle Button */
body.admin-page .admin-menu-toggle {
  display: none; /* Hidden by default, shown on mobile */
  background: none;
  border: none;
  color: var(--admin-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  body.admin-page .site-header .site-nav {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }
  
  body.admin-page .admin-menu-toggle {
    display: block;
  }
  
  /* Keep main nav visible on all admin pages, including Add Product and Add Banner */
  body.admin-page .site-header .site-nav > ul {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    padding: 0 10px !important;
  }
  
  body.admin-page .site-header .logo {
    text-align: left;
    min-width: auto;
  }
}

/* Ensure consistent spacing and alignment */
body.admin-page .site-header .site-nav,
body.admin-page .site-header .site-nav > ul,
body.admin-page .site-header .user-options {
  align-items: center;
}

/* RTL Language Support */
[dir='rtl'] body.admin-page .site-header .site-nav {
  direction: rtl;
  grid-template-columns: auto 1fr auto; /* Keep the same grid layout as LTR */
}

[dir='rtl'] body.admin-page .site-header .site-nav > ul {
  direction: rtl;
  margin: 0; /* Remove right margin */
  padding: 0 20px; /* Add padding for better spacing */
  justify-content: flex-start; /* Align to the start (right in RTL) */
}

[dir='rtl'] body.admin-page .site-header .user-options {
  margin-left: auto; /* Push user options to the left (start in RTL) */
  margin-right: 0;
  justify-content: flex-end;
  direction: ltr; /* Keep user options LTR */
}

[dir='rtl'] body.admin-page .site-header .logo {
  margin: 0 15px 0 0; /* Adjust logo margins for RTL */
  text-align: right;
}

[dir='rtl'] body.admin-page .admin-menu-toggle {
  margin-left: 0;
  margin-right: 10px;
}

/* Ensure text alignment in RTL */
[dir='rtl'] body.admin-page .site-header .site-nav > ul li {
  text-align: right;
}

/* Fix for the language switcher in RTL */
[dir='rtl'] .language-switcher {
  margin-left: 0;
  margin-right: 15px;
}

/* Make sure the logo has a fixed width */
body.admin-page .site-header .logo {
  min-width: 80px; /* Fixed width for the logo */
}
body.admin-page .site-header .user-options {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
}

/* Layout */
/* On admin, header should scroll with page to avoid covering sidebar */
body.admin-page .site-header {
  position: relative;
  z-index: 1000;
  background: var(--admin-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Responsive Styles
   ============================================ */

/* Large desktops and laptops */
@media screen and (max-width: 1200px) {
  #content {
    padding-left: 20px;
    width: calc(100% - 60px);
    left: 60px;
  }
  
  #content main {
    padding: 20px 16px;
  }
  
  .admin-page .site-header .site-nav {
    padding: 0 16px;
  }
  
  .admin-page .site-header .logo {
    font-size: 1.4rem;
  }
  
  /* Adjust form elements */
  .form-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-group label {
    margin-bottom: 8px;
  }
}

/* Tablets and small desktops */
@media screen and (max-width: 992px) {
  /* Show mobile menu toggle */
  .admin-menu-toggle {
    display: block !important;
  }
  
  /* Position sidebar off-screen by default */
  #sidebar {
    transform: translateX(-100%);
    width: 280px;
    transition: transform 0.3s ease;
  }
  
  /* Adjust content area */
  #content {
    width: 100%;
    left: 0;
    padding: 20px 16px;
  }
  
  /* Adjust header for mobile */
  .admin-page .site-header {
    padding: 10px 0;
  }
  
  .admin-page .site-nav {
    justify-content: flex-start !important;
  }
  
  /* Hide desktop navigation in mobile */
  .admin-page .site-nav > ul {
    display: none !important;
  }
  
  /* Adjust tables for mobile */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Adjust buttons for mobile */
  .btn {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  /* Adjust cards for mobile */
  .card {
    margin-bottom: 16px;
  }
  
  /* Admin nav adjustments */
  #content nav.admin-nav {
    top: 84px;
    padding: 0 10px;
  }
  
  /* Form adjustments */
  .admin-product-form .form-row {
    flex-direction: column;
  }
  
  .admin-product-form .form-group {
    width: 100%;
    margin-bottom: 15px;
  }
  
  /* Hide some elements on mobile */
  .hide-on-mobile {
    display: none !important;
  }
}

/* Mobile devices */
@media screen and (max-width: 768px) {
  /* Adjust header */
  .admin-page .site-header {
    padding: 8px 0;
  }
  
  .admin-page .site-header .logo {
    font-size: 1.2rem;
  }
  
  /* Adjust content padding */
  #content {
    padding: 15px 10px;
  }
  
  /* Adjust form elements */
  .form-control {
    font-size: 14px;
    padding: 8px 12px;
  }
  
  /* Adjust buttons */
  .btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  /* Adjust cards */
  .card {
    margin-bottom: 12px;
    border-radius: 8px;
  }
  
  .card-header {
    padding: 12px 15px;
  }
  
  .card-body {
    padding: 15px;
  }
  
  /* Adjust tables */
  .table th, .table td {
    padding: 8px;
    font-size: 13px;
  }
  
  /* Adjust modal */
  .modal-dialog {
    margin: 10px;
    width: auto;
  }
  
  /* Adjust search and filter */
  .search-and-filter {
    flex-direction: column;
    gap: 10px;
  }
  
  .filters {
    width: 100%;
  }
  
  /* Adjust form actions */
  .form-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .form-actions .btn {
    width: 100%;
    margin: 0;
  }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
  /* Adjust header */
  .admin-page .site-header {
    padding: 6px 0;
  }
  
  .admin-page .site-header .logo {
    font-size: 1.1rem;
  }
  
  /* Adjust content */
  #content {
    padding: 10px 8px;
  }
  
  /* Adjust buttons */
  .btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  /* Adjust form elements */
  .form-control {
    font-size: 13px;
    padding: 6px 10px;
  }
  
  /* Adjust tables */
  .table-responsive {
    border: none;
  }
  
  /* Adjust cards */
  .card {
    margin-bottom: 10px;
  }
  
  .card-header {
    padding: 10px 12px;
  }
  
  .card-body {
    padding: 12px;
  }
  
  /* Hide non-essential elements */
  .hide-on-small {
    display: none !important;
  }
}

/* Sidebar styles */
#sidebar {
  position: absolute;
  top: 84px; /* match normal header height */
  left: 0;
  height: calc(100vh - 84px); /* Full height minus header */
  width: 250px;
  background: var(--admin-surface);
  z-index: 9999; /* Maximum z-index to appear above content */
  overflow-y: auto;
  padding-top: 60px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

/* Mobile menu toggle button */
.admin-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--admin-text);
  font-size: 1.8rem;
  padding: 0.8rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.admin-menu-toggle:active {
  transform: scale(0.95);
}

/* When sidebar is collapsed */
body.sidebar-collapsed #sidebar {
  transform: translateX(-100%);
}

/* When sidebar is expanded on mobile */
body.sidebar-expanded #sidebar {
  transform: translateX(0);
  width: 280px;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.5);
}

/* Overlay when sidebar is open on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 84px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 899;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.sidebar-expanded .sidebar-overlay {
  display: block;
  opacity: 1;
}

#sidebar {
  transition: .3s ease;
  overflow-x: hidden;
  scrollbar-width: none;
}

#sidebar.hide {
  transform: translateX(-100%);
}

#sidebar .brand {
  font-size: 20px;
  font-weight: 700;
  height: 56px;
  display: flex;
  align-items: center;
  color: var(--admin-accent);
  padding: 0 16px;
}
#sidebar .brand .bx {
  min-width: 36px;
  display: flex;
  justify-content: center;
}
#sidebar .side-menu {
  width: 100%;
  margin-top: 32px;
}
#sidebar .side-menu li {
  height: 44px;
  background: transparent;
  margin-left: 6px;
  border-radius: 48px 0 0 48px;
  padding: 4px;
}
#sidebar .side-menu li.active {
  background: #000;
}
#sidebar .side-menu li a {
  width: 100%;
  height: 100%;
  background: var(--admin-surface-alt);
  display: flex;
  align-items: center;
  border-radius: 48px;
  font-size: 14px;
  color: var(--admin-text);
  white-space: nowrap;
}
#sidebar .side-menu li a .bx {
  min-width: 40px;
  display: flex;
  justify-content: center;
}
#sidebar .side-menu li a.logout {
  color: #ff6b6b;
}
#sidebar .side-menu li a:hover {
  color: var(--admin-accent);
}

/* Main content layout next to fixed sidebar */
#content {
  position: relative;
  width: calc(100% - 220px);
  left: 220px;
  transition: .3s ease;
}

#sidebar.hide ~ #content {
  width: calc(100% - 60px);
  left: 60px;
}

/* Ensure admin content sits below global fixed header */
body.has-fixed-header #content {
  margin-top: 84px; /* same as site-header.expanded height */
}

/* Admin internal navbar: sticky under header with 30px gap */
#content nav.admin-nav {
  height: 56px;
  background: var(--admin-surface);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 114px; /* 30px below header */
  z-index: 850;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
#content nav.admin-nav .bx.bx-menu {
  cursor: pointer;
  color: var(--admin-text);
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 18px;
}

#content nav.admin-nav .bx.bx-menu:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

#content nav.admin-nav .bx.bx-menu:active {
  transform: scale(0.95);
  background: rgba(255, 215, 0, 0.25);
  border-color: rgba(255, 215, 0, 0.4);
}
#content nav.admin-nav .nav-link {
  color: var(--admin-text);
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

#content nav.admin-nav .nav-link:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

#content nav.admin-nav .nav-link:active {
  transform: translateY(0);
  background: rgba(255, 215, 0, 0.25);
  border-color: rgba(255, 215, 0, 0.4);
}
#content nav.admin-nav form {
  max-width: 360px;
  width: 100%;
  margin-right: auto;
}
#content nav.admin-nav .form-input {
  display: flex;
  align-items: center;
  height: 32px;
}
#content nav.admin-nav .form-input input {
  flex-grow: 1;
  padding: 0 14px;
  height: 100%;
  border: none;
  background: var(--admin-surface-alt);
  border-radius: 999px 0 0 999px;
  outline: none;
  color: var(--admin-text);
  font-size: 0.9rem;
}
#content nav.admin-nav .form-input button {
  width: 34px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--admin-accent);
  color: #000;
  font-size: 18px;
  border: none;
  outline: none;
  border-radius: 0 999px 999px 0;
  cursor: pointer;
}
#content nav.admin-nav .swith-lm {
  margin-left: 12px;
}
#content nav.admin-nav .notification,
#content nav.admin-nav .profile {
  margin-left: 8px;
}

.categories-menu,
.notification-menu,
.profile-menu {
  background: var(--admin-surface-alt);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
  padding: 6px 0;
}
.categories-menu ul,
.notification-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.categories-menu li,
.notification-menu li {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.9rem;
  color: var(--admin-text);
}
.categories-menu li:last-child,
.notification-menu li:last-child {
  border-bottom: none;
}
.categories-menu li a {
  color: var(--admin-text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}

.categories-menu li:hover,
.notification-menu li:hover {
  background: rgba(255, 215, 0, 0.15) !important;
}

.categories-menu li a:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.categories-menu li a:active {
  transform: translateY(0);
  background: rgba(255, 215, 0, 0.25);
  border-color: rgba(255, 215, 0, 0.4);
}

/* Main area */
#content main {
  width: 100%;
  padding: 40px 24px 24px; /* بیشتر از قبل برای فاصله از نوبار */
  font-family: 'Poppins', system-ui, sans-serif;
  max-height: none;
}

.head-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 16px;
  margin-bottom: 12px;
}

.head-title .left h1 {
  color: var(--admin-accent);
}
.head-title .breadcrumb li,
.head-title .breadcrumb li a {
  color: var(--admin-muted);
}

.admin-session-card {
  margin-top: 16px;
  background: var(--admin-surface-alt);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 16px 20px;
}
.admin-session-card h2 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  color: var(--admin-accent);
}
.admin-session-card .session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--admin-text);
  padding: 6px 0;
  border-top: 1px dashed rgba(255,255,255,0.08);
}
.admin-session-card .session-row span:first-child {
  opacity: 0.7;
  font-size: 0.9rem;
}

.admin-login-history {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.86rem;
}
.admin-login-history li {
  padding: 4px 0;
  border-top: 1px dashed rgba(255,255,255,0.06);
  color: var(--admin-text);
}

.admin-link-button {
  border: none;
  background: transparent;
  color: var(--admin-accent);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.admin-history-card {
  margin-top: 20px;
  background: var(--admin-surface-alt);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 16px 20px;
}
.admin-history-card h2 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  color: var(--admin-accent);
}

.admin-visitors-details {
  margin-top: 8px;
  background: var(--admin-surface-alt);
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  padding: 8px 14px;
  display: none;
}
.admin-visitors-details.open {
  display: block;
}
.admin-visitors-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}
.admin-visitors-list li {
  padding: 4px 0;
  border-top: 1px dashed rgba(255,255,255,0.06);
}
.admin-visitors-list li:first-child {
  border-top: none;
}

.visitors-toggle .arrow {
  font-size: 0.8rem;
}

/* Admin dashboard main grid: users only (single column) */
.admin-main-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px);
  gap: 16px;
  margin-top: 16px;
  justify-content: start;
}

.admin-users-card {
  background: var(--admin-surface-alt);
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.admin-users-card h2 {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
  color: var(--admin-accent);
}
.admin-users-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}
.admin-users-list li {
  padding: 6px 4px;
  border-top: 1px dashed rgba(255,255,255,0.06);
  cursor: pointer;
}
.admin-users-list li:first-child {
  border-top: none;
}
.admin-users-list li.active {
  background: rgba(255,255,255,0.06);
}


/* Make visitors card not too wide */
.box-info {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
  grid-gap: 16px;
  margin-top: 20px;
}

/* Info cards */
.box-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-gap: 16px;
  margin-top: 20px;
}
.box-info li {
  padding: 20px;
  background: var(--admin-surface-alt);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.box-info li .bx {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255,255,255,0.06);
}
.box-info li:nth-child(1) .bx { color: #3C91E6; }
.box-info li:nth-child(2) .bx { color: #FFCE26; }

.box-info li .text h3 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--admin-text);
}
.box-info li .text p {
  margin: 0;
  color: var(--admin-muted);
}

@media screen and (max-width: 768px) {
  /* Top navbar in admin should stay horizontal even in mobile */
  body.admin-page nav.site-nav {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  body.admin-page nav.site-nav ul {
    flex-direction: row !important;
    gap: 0.6rem;
  }
  body.admin-page .user-options {
    flex-direction: row !important;
    gap: 0.4rem;
  }

  /* Stack sidebar above content to avoid horizontal scroll */
  #sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  #content {
    width: 100%;
    left: 0;
  }

  #content main {
    padding: 24px 16px;
  }

  .admin-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 600px) {
  body.admin-page nav.site-nav .logo {
    font-size: 1.4rem;
  }
  body.admin-page nav.site-nav ul li a {
    font-size: 0.9rem;
  }
  body.admin-page .user-options a {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
  }
}

@media screen and (max-width: 576px) {
  #content nav.admin-nav form .form-input input {
    display: none;
  }
  #content nav.admin-nav form.show .form-input input {
    display: block;
    width: 100%;
  }
}

/* Admin Products page layout */
.admin-products-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
}

/* Banners page: فقط یک ستون وسط صفحه برای فرم/جدول بنر */
.admin-banners-layout {
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
}

.admin-products-left,
.admin-products-right {
  background: var(--admin-surface-alt);
  border-radius: 16px;
  border: 1px solid var(--admin-border);
  padding: 18px 18px 20px;
}

.section-title {
  margin: 0 0 14px 0;
  font-size: 1.05rem;
  color: var(--admin-accent);
}

.brand-folders {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.brand-folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--admin-text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.brand-folder-row .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-accent);
}

.brand-folder-row .icon .bx {
  font-size: 1.2rem;
}

.brand-folder-row .label {
  flex: 1;
  text-align: left;
}

.brand-folder-row .count {
  font-size: 0.8rem;
  color: var(--admin-muted);
}

.brand-folder-row:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,215,0,0.6);
  transform: translateY(-1px);
}

.brand-folder-row.active {
  background: rgba(255,215,0,0.14);
  border-color: var(--admin-accent);
}

.brand-products {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}

.brand-products-title {
  font-size: 0.9rem;
  color: var(--admin-muted);
  margin-bottom: 6px;
}

.brand-products-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.product-folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 0.86rem;
  color: var(--admin-text);
}

.product-folder-row .icon {
  color: var(--admin-accent);
}

.product-folder-row .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-product-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-product-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 5px;
}

.admin-product-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-product-form label {
  font-size: 0.8rem;
  color: var(--admin-muted);
}

.admin-product-form input[type="text"],
.admin-product-form input[type="url"] {
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--admin-border);
  padding: 0 10px;
  font-size: 0.78rem;
  width: 100%;
  box-sizing: border-box;
  background: #050505;
  color: var(--admin-text);
}

.admin-product-form input[type="text"]:focus,
.admin-product-form input[type="url"]:focus {
  outline: none;
  border-color: rgba(255,215,0,0.7);
  box-shadow: 0 0 0 1px rgba(255,215,0,0.25);
}

.admin-product-form .form-group-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.radio-group {
  display: inline-flex;
  gap: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--admin-text);
}

.radio-group input[type="radio"] {
  width: 14px;
  height: 14px;
}

.images-block {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
  align-items: flex-start;
}

.images-block .ap-gallery-url {
  margin-bottom: 6px;
}

.input-with-upload {
  display: flex;
  align-items: center;
  gap: 6px;
}

.upload-btn {
  border: 1px solid var(--admin-border);
  background: rgba(255,255,255,0.05);
  color: var(--admin-accent);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.upload-btn:hover {
  background: rgba(255,255,255,0.1);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.form-actions-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-primary {
  border: none;
  border-radius: 999px;
  padding: 10px 26px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #ffd700, #ffb100);
  color: #000;
  box-shadow: 0 10px 26px rgba(0,0,0,0.6);
  transition: transform .08s ease, box-shadow .08s ease, filter .08s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.7);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

.status-text {
  font-size: 0.8rem;
  color: var(--admin-muted);
}

.admin-products-table-wrapper {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  overflow: hidden;
}

.admin-products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-products-table thead {
  background: rgba(255,255,255,0.04);
}

.admin-products-table th,
.admin-products-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.admin-products-table th {
  font-weight: 500;
  color: var(--admin-muted);
}

.admin-products-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.admin-products-table .empty-row {
  text-align: center;
  color: var(--admin-muted);
}

.quality.q-forged {
  color: #ffd700;
}

.quality.q-normal {
  color: #9be15d;
}

.icon-button {
  border: none;
  background: transparent;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Toggle switch for visibility */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: .2s;
  border-radius: 999px;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--admin-accent);
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

@media screen and (max-width: 900px) {
  .admin-products-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .images-block {
    grid-template-columns: minmax(0, 1fr);
  }
}
