:root {
  /* Fonts */
  --font-sans: 'Signika', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Signika', 'Fira Code', 'Courier New', monospace;

  /* Light Theme Variables */
  --bg-body: #f8fafc;
  --bg-sidebar: #f8fafc;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  --primary: #f59e0b;
  --primary-hover: #d97706;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #3b82f6;

  --sidebar-width: 250px;
  --header-height: 60px;
}

/* Dark theme removed */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

a {
  text-decoration: none;
  color: var(--primary);
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-main);
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .sidebar-settings,
.sidebar.collapsed .menu-header,
.sidebar.collapsed .menu-item span,
.sidebar.collapsed .user-balance-info,
.sidebar.collapsed .menu-item i.fa-chevron-right,
.sidebar.collapsed .menu-item i.fa-chevron-down {
  display: none;
}

.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 15px 0;
}

.sidebar.collapsed .menu-item i:first-child {
  margin-right: 0;
  font-size: 18px;
}

.sidebar-logo {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
  max-width: 100%;
  max-height: 100%;
}

.sidebar-settings {
  padding: 15px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-color);
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.form-select-sm {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 2px 5px;
  border-radius: 3px;
  outline: none;
}

.user-balance-info {
  margin-top: 15px;
  text-align: center;
  font-size: 11px;
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.menu-header {
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  margin-top: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin: 0 12px 4px 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  cursor: pointer;
}

.menu-item i:first-child {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.menu-item:hover {
  color: var(--text-main);
  background-color: var(--bg-card);
  transform: translateX(4px);
}

.menu-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  font-weight: 600;
}

.menu-item.active i,
.menu-item.active span {
  color: white !important;
}

.submenu-item {
  transition: all 0.2s;
}

.submenu-item:hover {
  color: var(--primary) !important;
  background-color: var(--bg-card);
}

.submenu-item.active {
  color: var(--primary) !important;
  font-weight: 600;
}

.bg-light.text-dark {
  background-color: #f8f9fa;
  color: #212529 !important;
}

.ms-auto {
  margin-left: auto;
}

.ms-2 {
  margin-left: 0.5rem;
}

.ms-3 {
  margin-left: 1rem;
}

.font-xs {
  font-size: 10px;
}

/* Main Wrapper */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header */
.content-header {
  height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
}

.btn-toggle-sidebar {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.theme-switch {
  background: var(--bg-body);
  border-radius: 20px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
}

.position-relative {
  position: relative;
}

.badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.username {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

/* Content Area */
.tab-panel {
  padding: 20px;
  flex: 1;
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  background-color: #334155;
  color: #f8fafc;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
  background-color: #e2e8f0;
  color: #0f172a;
  border: none;
}

.tab-btn:hover:not(.active) {
  background-color: #475569;
}

/* Products Table */
.card {
  background-color: var(--bg-card);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
  padding: 12px 15px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
}

[data-theme="dark"] .table th {
  background-color: rgba(255, 255, 255, 0.03);
}

.table th.text-center {
  text-align: center;
}

.table td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.product-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.flag-icon {
  width: 24px;
  height: 18px;
  border-radius: 2px;
  object-fit: cover;
  margin-top: 3px;
}

.product-details h4 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 5px;
  line-height: 1.4;
}

.product-details p {
  font-size: 12px;
  color: var(--text-muted);
}

.badge-stock {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--info);
  color: var(--info);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(13, 202, 240, 0.1);
}

.badge-price {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(220, 53, 69, 0.1);
}

.btn-buy {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-buy:hover {
  background-color: #2563eb;
}

.btn-buy:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Forms & Auth */
.auth-box {
  max-width: 400px;
  margin: 40px auto;
  padding: 30px;
}

.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 13px;
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-block {
  width: 100%;
  display: block;
  text-align: center;
  padding: 10px;
}

.alert {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 13px;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.alert-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: var(--success);
  border: 1px solid rgba(25, 135, 84, 0.2);
}

/* User Profile Dropdown */
.user-profile {
  position: relative;
  cursor: pointer;
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-profile:hover .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--text-main);
  text-decoration: none;
  transition: background 0.2s;
  font-size: 13px;
}

.profile-dropdown-item i {
  width: 20px;
  color: #94a3b8;
}

.profile-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

.profile-dropdown-item:hover i {
  color: var(--primary);
}

.profile-dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* Premium Checkout Styles */
.checkout-btn {
  background-color: var(--primary);
  color: #fff !important;
  transition: background-color 0.2s ease;
}

.checkout-btn:hover {
  background-color: var(--primary-hover);
}

.premium-input:focus,
.premium-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .premium-checkout-container {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-sidebar);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .sidebar.show-mobile {
    transform: translateX(0);
  }

  .app-layout {
    flex-direction: column;
  }

  .sidebar-logo {
    background-color: transparent !important;
  }

  /* Header Adjustments */
  .content-header {
    padding: 0 15px;
  }

  .header-left {
    gap: 10px !important;
  }

  .user-profile .user-info {
    display: none;
    /* Hide username text to save space on mobile */
  }

  /* Tab Panel Padding */
  .tab-panel {
    padding: 15px;
  }

  /* Tables responsiveness */
  .table-responsive {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    padding: 10px;
    font-size: 13px;
  }

  /* Index Categories */
  .category-tabs {
    gap: 8px;
  }

  .tab-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Product items */
  .product-item {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 15px !important;
  }

  .product-info {
    padding-right: 0 !important;
    margin-bottom: 15px !important;
  }

  .product-action {
    width: 100% !important;
    flex-shrink: 1 !important;
  }

  /* Footer responsive layout */
  footer>div {
    flex-direction: column !important;
    padding: 30px 20px 20px 20px !important;
    gap: 25px !important;
  }

  footer>div>div {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  footer>div>div img {
    margin-bottom: 5px !important;
  }

  /* Quick style overlays */
  .auth-box {
    margin: 20px auto;
    padding: 20px;
  }
}

/* OVERRIDE MENU ITEMS TO MATCH ADMIN SIDEBAR */
.menu-item,
.submenu .menu-item {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 16px !important;
  color: var(--text-muted) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 6px !important;
  margin-bottom: 2px !important;
  background-color: transparent !important;
}

.menu-item:hover,
.submenu .menu-item:hover {
  color: var(--text-main) !important;
  background-color: #f1f5f9 !important;
  transform: translateX(4px) !important;
}

.menu-item.active,
.submenu .menu-item.active {
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important;
  font-weight: 600 !important;
  transform: none !important;
}

.menu-item svg:not(.submenu-icon) {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.2 !important;
  margin-right: 0 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  color: var(--text-muted) !important;
}

.menu-item:hover svg:not(.submenu-icon) {
  color: var(--primary) !important;
  transform: scale(1.1) !important;
}

.menu-item.active svg:not(.submenu-icon) {
  color: white !important;
}

.submenu-icon {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 2.2 !important;
  margin-left: auto !important;
  transition: transform 0.3s !important;
}

.btn-outline-primary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
}

.btn-outline-primary svg {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 2.2 !important;
}