:root {
  /* Colors */
  --primary-gold: #c9a84c;
  --primary-gold-dark: #a68936;
  --bg-color: #faf8f5;
  --surface: #ffffff;
  --surface-alt: #f1efe9;
  --text-main: #2c3e50;
  --text-muted: #6c7a89;
  --border-color: #e5e0d8;
  --sidebar-bg: #1a1e23;
  --sidebar-text: #b0b8c1;
  --sidebar-active: #c9a84c;
  --sidebar-active-bg: rgba(201, 168, 76, 0.1);
  
  /* Status Colors */
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  
  /* Utilities */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --border-radius: 8px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
}

.brand-font {
  font-family: 'Playfair Display', serif;
  letter-spacing: 2px;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 500;
}

/* Layout */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.app-container.active {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  z-index: 100;
}
.sidebar.collapsed {
  margin-left: -260px;
}

.sidebar-header {
  padding: 24px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  color: #fff;
  font-size: 20px;
  margin: 0 auto;
}

.sidebar-user {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-user .avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

.sidebar-user .name {
  color: #fff;
  font-weight: 500;
  font-size: 14px;
}

.sidebar-user .role {
  font-size: 12px;
  color: var(--primary-gold);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-header {
  padding: 15px 24px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
}

.nav-item {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.nav-item.active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
  border-left: 3px solid var(--sidebar-active);
}

.mobile-category-submenu {
  display: none;
}

/* Main Content */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: 70px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-main);
  cursor: pointer;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border-radius: 20px;
  padding: 8px 16px;
  width: 300px;
}

.search-bar i {
  color: var(--text-muted);
  margin-right: 10px;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-family: inherit;
}

.topbar-actions {
  display: flex;
  gap: 15px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--primary-gold);
}

.badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: 600;
}

/* Views */
.view-container {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 30px;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}
.view-section.active {
  display: block;
}

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

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
}

.page-title {
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 5px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-gold);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.bg-gold { background: var(--primary-gold); }
.bg-blue { background: var(--info); }
.bg-purple { background: #9b59b6; }
.bg-red { background: var(--danger); }

.stat-details .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.stat-details .stat-value {
  font-size: 24px;
  margin-bottom: 5px;
}

.stat-trend {
  font-size: 12px;
  font-weight: 500;
}
.stat-trend.positive { color: var(--success); }
.stat-trend.negative { color: var(--danger); }
.stat-trend.neutral { color: var(--warning); }

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 16px;
  margin-bottom: 20px;
  font-weight: 600;
}

.chart-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Tables */
.table-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: visible;
  margin-bottom: 30px;
}

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

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--surface-alt);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.data-table td {
  font-size: 14px;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(201, 168, 76, 0.03);
}

.orders-table {
  table-layout: fixed;
  min-width: 1180px;
}

.orders-table th,
.orders-table td {
  padding: 14px 18px;
}

.orders-table th:nth-child(1),
.orders-table td:nth-child(1) { width: 115px; }
.orders-table th:nth-child(2),
.orders-table td:nth-child(2) { width: 160px; }
.orders-table th:nth-child(3),
.orders-table td:nth-child(3) { width: 390px; }
.orders-table th:nth-child(4),
.orders-table td:nth-child(4) { width: 150px; }
.orders-table th:nth-child(5),
.orders-table td:nth-child(5) { width: 120px; }
.orders-table th:nth-child(6),
.orders-table td:nth-child(6) { width: 150px; }
.orders-table th:nth-child(7),
.orders-table td:nth-child(7) { width: 145px; }
.orders-table th:nth-child(8),
.orders-table td:nth-child(8) { width: 90px; text-align: center; }

/* Products Table - Desktop (min-width: 992px): Fixed, single screen */
@media (min-width: 992px) {
  .products-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .products-table th,
  .products-table td {
    padding: 10px 8px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
  }

  .products-table th:nth-child(1),
  .products-table td:nth-child(1) { width: 55px !important; text-align: center !important; } /* Image */
  .products-table th:nth-child(2),
  .products-table td:nth-child(2) { width: auto !important; text-align: left !important; } /* Product Name */
  .products-table th:nth-child(3),
  .products-table td:nth-child(3) { width: 140px !important; text-align: left !important; white-space: nowrap !important; } /* Category */
  .products-table th:nth-child(4),
  .products-table td:nth-child(4) { width: 105px !important; text-align: left !important; white-space: nowrap !important; } /* Price */
  .products-table th:nth-child(5),
  .products-table td:nth-child(5) { width: 70px !important; text-align: center !important; } /* Stock */
  .products-table th:nth-child(6),
  .products-table td:nth-child(6) { width: 115px !important; text-align: center !important; } /* Status */
  .products-table th:nth-child(7),
  .products-table td:nth-child(7) { width: 115px !important; text-align: center !important; white-space: nowrap !important; } /* Order */
  .products-table th:nth-child(8),
  .products-table td:nth-child(8) { width: 105px !important; text-align: center !important; white-space: nowrap !important; } /* Actions */
}

/* ==========================================================================
   MOBILE & TABLET (< 992px): UNIVERSAL STICKY COLUMNS & SMOOTH HORIZONTAL SCROLL
   Applies to Products, Orders, Notify Me, Customers, and Categories
   ========================================================================== */
@media (max-width: 991px) {
  /* Smooth horizontal scrolling for all table wrappers */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain;
    padding-bottom: 8px;
    position: relative;
  }

  /* --------------------------------------------------------------------------
     1. PRODUCTS TABLE: Sticky Image + Sticky Product Name
     -------------------------------------------------------------------------- */
  .products-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 680px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  .products-table th,
  .products-table td {
    padding: 8px 7px !important;
    vertical-align: middle !important;
    font-size: 11.5px !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid #edf2f7 !important;
  }

  .products-table th {
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    background: #f8fafc !important;
  }

  /* Sticky Image (Col 1) */
  .products-table th:nth-child(1),
  .products-table td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background: #ffffff !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    text-align: center !important;
    padding: 6px 4px !important;
  }
  .products-table th:nth-child(1) { z-index: 5 !important; background: #f8fafc !important; }

  /* Sticky Product Name (Col 2) */
  .products-table th:nth-child(2),
  .products-table td:nth-child(2) {
    position: sticky !important;
    left: 46px !important;
    z-index: 2 !important;
    background: #ffffff !important;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    text-align: left !important;
    padding: 6px 8px !important;
    box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.12) !important;
  }
  .products-table th:nth-child(2) { z-index: 5 !important; background: #f8fafc !important; }

  .products-table td:nth-child(2) strong {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    color: #1a202c !important;
  }
  .products-table td:nth-child(2) small {
    display: block !important;
    font-size: 10px !important;
    color: #888 !important;
    margin-top: 2px !important;
  }

  .products-table tbody tr:hover td:nth-child(1),
  .products-table tbody tr:hover td:nth-child(2) {
    background: #faf7ef !important;
  }

  .products-table .category-header-row td {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    background: #faf6ed !important;
    padding: 7px 10px !important;
    font-size: 11.5px !important;
    text-align: left !important;
    border-top: 1px solid #e2d2ae !important;
    border-bottom: 1px solid #e2d2ae !important;
  }

  .products-table th:nth-child(3), .products-table td:nth-child(3) { width: 105px !important; min-width: 105px !important; white-space: nowrap !important; text-align: left !important; }
  .products-table th:nth-child(4), .products-table td:nth-child(4) { width: 85px !important; min-width: 85px !important; white-space: nowrap !important; text-align: left !important; font-weight: 600 !important; }
  .products-table th:nth-child(5), .products-table td:nth-child(5) { width: 50px !important; min-width: 50px !important; text-align: center !important; }
  .products-table th:nth-child(6), .products-table td:nth-child(6) { width: 80px !important; min-width: 80px !important; text-align: center !important; }
  .products-table th:nth-child(7), .products-table td:nth-child(7) { width: 95px !important; min-width: 95px !important; text-align: center !important; }
  .products-table th:nth-child(8), .products-table td:nth-child(8) { width: 90px !important; min-width: 90px !important; text-align: center !important; }

  .products-table .prod-thumb { width: 34px !important; height: 34px !important; border-radius: 4px !important; }
  .products-table .cat-pill { padding: 2px 7px !important; font-size: 11px !important; }
  .product-actions { display: inline-flex !important; gap: 3px !important; flex-wrap: nowrap !important; }
  .product-actions .action-btn { width: 27px !important; height: 27px !important; padding: 0 !important; font-size: 11px !important; border-radius: 4px !important; }
  .display-order-input { width: 44px !important; height: 26px !important; font-size: 11px !important; padding: 1px 2px !important; }
  .order-btn-up, .order-btn-down { height: 26px !important; padding: 2px 5px !important; font-size: 10px !important; }

  /* --------------------------------------------------------------------------
     2. ORDERS TABLE: Sticky Order ID + Sticky Customer Name
     -------------------------------------------------------------------------- */
  .orders-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 780px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  .orders-table th,
  .orders-table td {
    padding: 8px 8px !important;
    font-size: 11.5px !important;
    border-bottom: 1px solid #edf2f7 !important;
    vertical-align: middle !important;
  }

  .orders-table th {
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    background: #f8fafc !important;
  }

  /* Sticky Order ID (Col 1) */
  .orders-table th:nth-child(1),
  .orders-table td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background: #ffffff !important;
    width: 85px !important;
    min-width: 85px !important;
    max-width: 85px !important;
    padding: 6px 6px !important;
    white-space: nowrap !important;
  }
  .orders-table th:nth-child(1) { z-index: 5 !important; background: #f8fafc !important; }

  /* Sticky Customer (Col 2) */
  .orders-table th:nth-child(2),
  .orders-table td:nth-child(2) {
    position: sticky !important;
    left: 85px !important;
    z-index: 2 !important;
    background: #ffffff !important;
    width: 125px !important;
    min-width: 125px !important;
    max-width: 125px !important;
    padding: 6px 8px !important;
    box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.12) !important;
  }
  .orders-table th:nth-child(2) { z-index: 5 !important; background: #f8fafc !important; }

  .orders-table tbody tr:hover td:nth-child(1),
  .orders-table tbody tr:hover td:nth-child(2) {
    background: #faf7ef !important;
  }

  .orders-table th:nth-child(3), .orders-table td:nth-child(3) { width: 170px !important; min-width: 170px !important; }
  .orders-table th:nth-child(4), .orders-table td:nth-child(4) { width: 90px !important; min-width: 90px !important; white-space: nowrap !important; }
  .orders-table th:nth-child(5), .orders-table td:nth-child(5) { width: 85px !important; min-width: 85px !important; white-space: nowrap !important; font-weight: 600 !important; }
  .orders-table th:nth-child(6), .orders-table td:nth-child(6) { width: 85px !important; min-width: 85px !important; }
  .orders-table th:nth-child(7), .orders-table td:nth-child(7) { width: 110px !important; min-width: 110px !important; }
  .orders-table th:nth-child(8), .orders-table td:nth-child(8) { width: 85px !important; min-width: 85px !important; text-align: center !important; }

  /* --------------------------------------------------------------------------
     3. NOTIFY ME TABLE: Sticky Product (Image + Name + Code)
     -------------------------------------------------------------------------- */
  .notify-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 650px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  .notify-table th,
  .notify-table td {
    padding: 8px 8px !important;
    font-size: 11.5px !important;
    border-bottom: 1px solid #edf2f7 !important;
    vertical-align: middle !important;
  }

  .notify-table th {
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    background: #f8fafc !important;
  }

  /* Sticky Product (Col 1) */
  .notify-table th:nth-child(1),
  .notify-table td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background: #ffffff !important;
    width: 165px !important;
    min-width: 165px !important;
    max-width: 165px !important;
    padding: 6px 8px !important;
    box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.12) !important;
  }
  .notify-table th:nth-child(1) { z-index: 5 !important; background: #f8fafc !important; }

  .notify-table tbody tr:hover td:nth-child(1) {
    background: #faf7ef !important;
  }

  .notify-table .notify-group-row td {
    position: sticky !important;
    left: 0 !important;
    z-index: 3 !important;
    background: #faf6ed !important;
    padding: 7px 10px !important;
    font-size: 11.5px !important;
    text-align: left !important;
    border-top: 1px solid #e2d2ae !important;
    border-bottom: 1px solid #e2d2ae !important;
  }

  .notify-table th:nth-child(2), .notify-table td:nth-child(2) { width: 110px !important; min-width: 110px !important; }
  .notify-table th:nth-child(3), .notify-table td:nth-child(3) { width: 120px !important; min-width: 120px !important; white-space: nowrap !important; }
  .notify-table th:nth-child(4), .notify-table td:nth-child(4) { width: 110px !important; min-width: 110px !important; white-space: nowrap !important; }
  .notify-table th:nth-child(5), .notify-table td:nth-child(5) { width: 85px !important; min-width: 85px !important; white-space: nowrap !important; }
  .notify-table th:nth-child(6), .notify-table td:nth-child(6) { width: 65px !important; min-width: 65px !important; text-align: center !important; }

  /* --------------------------------------------------------------------------
     4. CUSTOMERS TABLE: Sticky Checkbox + Sticky Customer Name
     -------------------------------------------------------------------------- */
  .user-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 680px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  .user-table th,
  .user-table td {
    padding: 8px 8px !important;
    font-size: 11.5px !important;
    border-bottom: 1px solid #edf2f7 !important;
    vertical-align: middle !important;
  }

  .user-table th {
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    background: #f8fafc !important;
  }

  /* Sticky Checkbox (Col 1) */
  .user-table th:nth-child(1),
  .user-table td:nth-child(1) {
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background: #ffffff !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    text-align: center !important;
    padding: 6px 4px !important;
  }
  .user-table th:nth-child(1) { z-index: 5 !important; background: #f8fafc !important; }

  /* Sticky Customer (Col 2) - 165px wide, cleanly truncated with ellipsis, no overflow */
  .user-table th:nth-child(2),
  .user-table td:nth-child(2) {
    position: sticky !important;
    left: 36px !important;
    z-index: 2 !important;
    background: #ffffff !important;
    width: 165px !important;
    min-width: 165px !important;
    max-width: 165px !important;
    padding: 6px 8px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.12) !important;
  }
  .user-table th:nth-child(2) { z-index: 5 !important; background: #f8fafc !important; }

  .user-table tbody tr:hover td:nth-child(1),
  .user-table tbody tr:hover td:nth-child(2) {
    background: #faf7ef !important;
  }

  /* Contact (Col 3) - clean spacing, no overlap */
  .user-table th:nth-child(3), .user-table td:nth-child(3) {
    width: 115px !important;
    min-width: 115px !important;
    white-space: nowrap !important;
    padding: 6px 10px !important;
  }
  .user-table th:nth-child(4), .user-table td:nth-child(4) { width: 90px !important; min-width: 90px !important; white-space: nowrap !important; }
  .user-table th:nth-child(5), .user-table td:nth-child(5) { width: 110px !important; min-width: 110px !important; }
  .user-table th:nth-child(6), .user-table td:nth-child(6) { width: 75px !important; min-width: 75px !important; }
  .user-table th:nth-child(7), .user-table td:nth-child(7) { width: 80px !important; min-width: 80px !important; }
  .user-table th:nth-child(8), .user-table td:nth-child(8) { width: 75px !important; min-width: 75px !important; text-align: center !important; }

  /* --------------------------------------------------------------------------
     5. CATEGORIES VIEW: Clean touch scroll for tags & subcategories
     -------------------------------------------------------------------------- */
  #view-categories .cat-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 12px 14px !important;
  }

  #view-categories .cat-card-body > div:last-child {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
    padding-bottom: 6px !important;
  }

  #view-categories .subcat-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 4px 9px !important;
  }
}

.order-id-cell {
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.order-customer-cell .customer-name {
  font-weight: 500;
  line-height: 1.2;
}

.order-customer-cell .customer-phone,
.order-date-cell,
.order-track-text {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.order-products {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-product-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.order-product-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fafafa;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.order-product-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-product-meta {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-more-items {
  color: var(--primary-gold);
  font-size: 11px;
  font-weight: 600;
  margin-left: 54px;
}

.order-status-select {
  max-width: 120px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 18px;
}

.order-track-btn {
  margin-top: 6px;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.1;
}

.order-actions,
.product-actions,
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}

.order-actions .action-btn,
.product-actions .action-btn,
.table-actions .action-btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.data-table td:last-child {
  white-space: nowrap !important;
}

.data-table td:last-child .action-btn {
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.data-table td:last-child .action-btn:last-child {
  margin-right: 0;
}

/* Badges */
.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-badge.completed { background: rgba(39, 174, 96, 0.1); color: var(--success); }
.status-badge.pending { background: rgba(243, 156, 18, 0.1); color: var(--warning); }
.status-badge.processing { background: rgba(52, 152, 219, 0.1); color: var(--info); }
.status-badge.cancelled { background: rgba(231, 76, 60, 0.1); color: var(--danger); }
.status-badge.instock { background: rgba(39, 174, 96, 0.1); color: var(--success); }
.status-badge.lowstock { background: rgba(243, 156, 18, 0.1); color: var(--warning); }
.status-badge.outstock { background: rgba(231, 76, 60, 0.1); color: #c0392b; }
.status-badge.hidden { background: rgba(150, 150, 150, 0.1); color: #888; }

/* Buttons */
.btn-primary {
  background: var(--primary-gold);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--primary-gold-dark);
  box-shadow: 0 4px 10px rgba(201, 168, 76, 0.3);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #e5e0d8;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary-gold);
  font-weight: 500;
  cursor: pointer;
}
.btn-text:hover {
  text-decoration: underline;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 10px;
  font-size: 16px;
  transition: var(--transition);
}
.action-btn:hover { color: var(--primary-gold); }
.action-btn.delete:hover { color: var(--danger); }

/* Forms */
.filter-group {
  display: flex;
  gap: 15px;
}
.form-input, .form-select {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  background: var(--surface);
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary-gold);
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  height: 100dvh;
  min-height: 100%;
  background: linear-gradient(135deg, #1a1e23, #2c3e50);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px;
  transition: opacity 0.3s ease;
}
.login-overlay.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  display: none !important;
  visibility: hidden !important;
}

.login-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin: auto;
}

.login-logo { margin-bottom: 30px; }
.login-logo h1 { color: var(--primary-gold); font-size: 28px; }
.login-logo p { color: #fff; opacity: 0.7; font-size: 14px; }

.input-group {
  position: relative;
  margin-bottom: 20px;
}
.input-group > i.input-icon-left,
.input-group > i:first-child {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 15px;
  z-index: 2;
}
.input-group input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input[type="password"],
.input-group input.has-toggle {
  padding-right: 48px;
}
.input-group input::placeholder { color: rgba(255,255,255,0.5); }
.input-group input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.25);
}

/* Eye Toggle Button */
.toggle-password-btn {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.65) !important;
  cursor: pointer !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  z-index: 5 !important;
  transition: color 0.2s ease, background-color 0.2s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}
.toggle-password-btn:hover,
.toggle-password-btn:focus {
  color: var(--primary-gold) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
.toggle-password-btn i {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  font-size: 15px !important;
  color: inherit !important;
  pointer-events: none !important;
}

.login-meta-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
  margin-bottom: 14px;
}
.forgot-password-link {
  background: none;
  border: none;
  color: var(--primary-gold);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  padding: 4px 0;
  transition: opacity 0.2s, text-decoration 0.2s;
  font-family: inherit;
}
.forgot-password-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.login-card .btn-primary { width: 100%; padding: 12px; justify-content: center; margin-top: 10px; }

.error-msg {
  color: #ff6b6b;
  font-size: 13px;
  margin-bottom: 15px;
  min-height: 18px;
  line-height: 1.4;
}

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal.active {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  background: var(--surface);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: var(--transition);
}
.modal.active .modal-content {
  transform: translateY(0);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close-modal { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}
.form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.form-group { flex: 1; }
.form-group label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form-group .form-input, .form-group .form-select { width: 100%; }

.file-upload {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.file-upload:hover { border-color: var(--primary-gold); color: var(--primary-gold); }
.file-upload i { font-size: 30px; margin-bottom: 10px; }

/* Product Image in Table */
.prod-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: contain; background-color: #fafafa;
  border: 1px solid var(--border-color);
}

/* Placeholder */
.placeholder-content {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
}
.placeholder-content i {
  font-size: 60px;
  color: var(--border-color);
  margin-bottom: 20px;
}

/* Responsive */
.d-md-none { display: none; }

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

@media (max-width: 768px) {
  html,
  body,
  .app-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .app-container {
    height: 100dvh;
  }
  .main-content {
    width: 100%;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: 64px;
    flex-shrink: 0;
    padding: 0 22px;
  }
  .view-container {
    padding: 24px 16px;
  }
  .login-card {
    width: 100% !important;
    max-width: 380px !important;
    padding: 30px 20px !important;
    margin: auto !important;
    box-sizing: border-box !important;
  }
  .login-card .input-group input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    padding: 13px 15px 13px 44px !important;
  }
  .login-card .btn-primary {
    min-height: 48px !important;
    font-size: 15px !important;
    touch-action: manipulation;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    height: 100%;
  }
  .sidebar.open { left: 0; }
  .mobile-category-submenu {
    display: none;
    padding: 4px 14px 12px 54px;
    background: rgba(0, 0, 0, 0.16);
  }
  .mobile-category-submenu.open {
    display: block;
  }
  .mobile-category-group {
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .mobile-category-group:last-child {
    border-bottom: 0;
  }
  .mobile-category-toggle,
  .mobile-subcategory-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--sidebar-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
  }
  .mobile-category-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
  }
  .mobile-category-toggle i {
    width: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
  }
  .mobile-category-group.open .mobile-category-toggle {
    color: #fff;
  }
  .mobile-category-group.open .mobile-category-toggle i {
    transform: rotate(180deg);
  }
  .mobile-subcategory-list {
    display: none;
    padding: 0 0 8px 10px;
  }
  .mobile-category-group.open .mobile-subcategory-list {
    display: block;
  }
  .mobile-subcategory-item {
    display: block;
    padding: 8px 0;
    font-size: 12px;
    line-height: 1.35;
  }
  .mobile-subcategory-item:hover,
  .mobile-subcategory-item:focus {
    color: var(--sidebar-active);
    outline: none;
  }
  .d-md-none { display: block; }
  .search-bar { display: none; }
}

/* --- User Management Dashboard --- */
.luxury-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.luxury-card:hover {
  border-color: var(--primary-gold);
  box-shadow: 0 12px 48px rgba(201, 168, 76, 0.15);
}

.bg-green { background: #27ae60; }
.bg-darkgold { background: #8e732c; }

/* Segmentation Tabs */
.segmentation-tabs {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.segment-btn {
  background: var(--surface);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.segment-btn:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}

.segment-btn.active {
  background: var(--primary-gold);
  color: #fff;
  border-color: var(--primary-gold);
}

.segment-btn.active i {
  color: #fff !important;
}

/* User Table Specifics */
.user-table .user-info-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-table .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain; background-color: #fafafa;
  border: 2px solid var(--border-color);
}

.user-table .user-name {
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.user-table .user-email {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--success);
}

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

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Drawer / Side Panel */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100%;
  background: var(--surface);
  box-shadow: -5px 0 25px rgba(0,0,0,0.1);
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

.drawer-overlay.active .drawer-content {
  right: 0;
}

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

.close-drawer {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.drawer-profile-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 25px;
}

.drawer-profile-top img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary-gold);
  margin-bottom: 15px;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}

.drawer-profile-top h3 {
  font-size: 20px;
  margin-bottom: 5px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}

.info-item label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-item span {
  font-size: 14px;
  font-weight: 500;
}

.drawer-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-gold);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 15px;
  margin-top: 25px;
}

.timeline {
  position: relative;
  border-left: 2px solid var(--border-color);
  margin-left: 10px;
  padding-left: 20px;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-icon {
  position: absolute;
  left: -29px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-gold);
  border: 3px solid var(--surface);
}

.timeline-content h4 {
  font-size: 14px;
  margin-bottom: 3px;
}

.timeline-content p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Category Tabs */
.cat-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.cat-tab:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}
.cat-tab.active {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
  color: #fff;
  font-weight: 600;
}

/* Sub Category Pills */
.subcat-pill {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.subcat-pill:hover {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}
.subcat-pill.active {
  background: rgba(201,168,76,0.15);
  border-color: var(--primary-gold);
  color: var(--primary-gold-dark);
  font-weight: 600;
}

#subcat-row {
  display: flex;
  animation: fadeInDown 0.25s ease;
}
@keyframes fadeInDown {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: translateY(0); }
}

/* Category Cards (expandable) */
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.cat-card:hover {
  border-color: var(--primary-gold);
  box-shadow: var(--shadow-md);
}
.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.cat-card-body {
  display: none;
  padding: 14px 20px 18px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-alt);
  animation: fadeInDown 0.2s ease;
}
.cat-card.open .cat-card-body {
  display: block;
}
.cat-card.open .cat-chevron {
  transform: rotate(180deg);
}

/* Subcategory Tags (inside category cards) */
.subcat-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1.5px solid var(--primary-gold);
  color: var(--primary-gold-dark);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
}

/* ===== Cascading Category Dropdown ===== */
.cascade-wrap { position: relative; display: inline-block; }

.cascade-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 210px;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 10px 14px;
  color: var(--text-main);
  transition: border-color 0.2s;
}
.cascade-trigger:hover { border-color: var(--primary-gold); }
.cascade-trigger.open { border-color: var(--primary-gold); }
.cascade-trigger .fa-chevron-down { transition: transform 0.25s; }
.cascade-trigger.open .fa-chevron-down { transform: rotate(180deg); }

.cascade-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 460px;
  overflow: hidden;
  animation: fadeInDown 0.18s ease;
}
.cascade-panel.open { display: flex; }

.cascade-left {
  width: 200px;
  border-right: 1px solid var(--border-color);
  padding: 6px 0;
  flex-shrink: 0;
}
.cascade-right {
  flex: 1;
  padding: 6px 0;
  background: var(--surface-alt);
}

.cascade-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cascade-cat-item:hover,
.cascade-cat-item.hovered { background: rgba(201,168,76,0.08); border-left-color: var(--primary-gold); }
.cascade-cat-item.selected { background: rgba(201,168,76,0.12); border-left-color: var(--primary-gold); color: var(--primary-gold-dark); font-weight: 600; }

.cascade-subcat-title {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.cascade-subcat-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.cascade-subcat-item:hover { background: rgba(201,168,76,0.1); color: var(--primary-gold-dark); border-left-color: var(--primary-gold); }
.cascade-subcat-item.selected { color: var(--primary-gold-dark); font-weight: 600; background: rgba(201,168,76,0.15); border-left-color: var(--primary-gold); }

@media (max-width: 640px) {
  .cascade-panel { flex-direction: column; min-width: 280px; }
  .cascade-left { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
}

/* Mobile admin cleanup */
@media (max-width: 768px) {
  .topbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  }

  .menu-toggle,
  .icon-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .badge {
    top: 6px;
    right: 4px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-header > div,
  .page-header > button,
  .page-header > div:last-child {
    width: 100%;
  }

  .page-header > div:last-child {
    flex-wrap: wrap;
  }

  .page-title {
    font-size: 21px;
    line-height: 1.2;
  }

  .page-subtitle {
    font-size: 13px;
    line-height: 1.4;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card,
  .chart-card,
  .table-card {
    border-radius: 8px;
  }

  .stat-card,
  .chart-card {
    padding: 18px;
  }

  .card-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .filter-group {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .filter-group .form-input,
  .filter-group .form-select,
  .cascade-wrap,
  .cascade-trigger {
    width: 100%;
    min-width: 0;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 42px;
    justify-content: center;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 760px;
  }

  

  .orders-table {
    min-width: 980px;
  }

  .cat-card-header {
    align-items: flex-start;
    gap: 12px;
  }

  .cat-card-header > div:first-child {
    min-width: 0;
  }

  .cat-card-header > div:last-child {
    flex-shrink: 0;
  }

  .modal-content {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .drawer-content {
    width: min(100%, 420px);
  }
}

@media (max-width: 560px) {
  .view-container {
    padding: 22px 14px;
  }

  .notify-toolbar {
    overflow-x: visible !important;
  }

  .notify-toolbar,
  .notify-toolbar .filter-group {
    align-items: stretch !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }

  .notify-toolbar .filter-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px !important;
  }

  #notify-search-filter {
    grid-column: 1 / -1;
  }

  #notify-search-filter,
  #notify-category-filter,
  #notify-color-filter,
  #notify-size-filter,
  #notify-auto-select-count {
    width: 100% !important;
    min-width: 0 !important;
  }

  .notify-toolbar > div:last-child {
    display: grid !important;
    grid-template-columns: 86px 1fr 1fr;
    gap: 10px !important;
    width: 100%;
  }

  .notify-toolbar .btn-secondary {
    width: 100%;
    padding: 10px 8px !important;
    white-space: normal !important;
    line-height: 1.15;
  }

  .notify-table-wrap {
    overflow: visible;
  }

  .notify-table,
  .notify-table thead,
  .notify-table tbody,
  .notify-table tr,
  .notify-table td {
    display: block;
    width: 100%;
  }

  .notify-table thead {
    display: none;
  }

  .notify-table tbody {
    padding: 0 12px 14px;
  }

  .notify-table .notify-group-row,
  .notify-table .notify-product-row {
    margin: 12px 0 8px;
    border: 0;
  }

  .notify-table .notify-group-row td,
  .notify-table .notify-product-row td {
    border: 0;
    border-radius: 6px;
    display: block;
    padding: 10px 12px !important;
  }

  .notify-request-row {
    position: relative;
    margin: 10px 0;
    padding: 12px 12px 12px 46px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
  }

  .notify-request-row td {
    border: 0;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.35;
  }

  .notify-select-cell {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 22px !important;
    padding: 0 !important;
  }

  .notify-select-cell input {
    width: 20px;
    height: 20px;
  }

  .notify-request-row td[data-label] {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .notify-request-row td[data-label]::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }

  .notify-product-cell {
    min-width: 0 !important;
    align-items: flex-start !important;
  }

  .notify-product-cell > div {
    min-width: 0;
  }

  .notify-product-cell a {
    display: block;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .notify-request-row .order-actions {
    justify-content: flex-start;
    gap: 14px;
  }

  .notify-request-row .action-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-radius: 6px;
    background: var(--surface-alt);
  }

  .notify-product-summary-row {
    display: block;
    margin: 10px 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
  }

  .notify-product-summary-row td {
    border: 0;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.35;
  }

  .notify-product-summary-row td[data-label] {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .notify-product-summary-row td[data-label]::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }
}

.notify-product-summary-row {
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.notify-product-summary-row:hover {
  background: #fbfaf7;
}

.notify-product-open:hover {
  color: var(--primary-gold) !important;
}

.notify-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.notify-detail-panel {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.notify-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-color);
}

.notify-detail-product {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.notify-detail-product img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex: 0 0 auto;
}

.notify-detail-product h2 {
  margin: 0 0 8px;
  color: var(--text-dark);
  font-size: 24px;
  line-height: 1.2;
}

.notify-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notify-detail-meta span {
  background: #f7f2e6;
  color: #7a5b14;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
}

.notify-detail-close {
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.notify-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: #fbfaf7;
  border-bottom: 1px solid var(--border-color);
}

.notify-detail-count span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.notify-detail-count strong {
  display: block;
  color: #0f9f57;
  font-size: 34px;
  line-height: 1;
}

.notify-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.notify-detail-actions input {
  width: 110px;
}

.notify-detail-table-wrap {
  padding: 0 24px 24px;
}

.notify-detail-table th:first-child,
.notify-detail-table td:first-child {
  width: 42px;
}

@media (max-width: 768px) {
  .notify-detail-modal {
    align-items: stretch;
    padding: 10px;
  }

  .notify-detail-panel {
    max-height: calc(100vh - 20px);
  }

  .notify-detail-head,
  .notify-detail-summary {
    padding: 16px;
  }

  .notify-detail-product {
    align-items: flex-start;
  }

  .notify-detail-product img {
    width: 56px;
    height: 56px;
  }

  .notify-detail-product h2 {
    font-size: 19px;
  }

  .notify-detail-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .notify-detail-actions {
    justify-content: flex-start;
  }

  .notify-detail-actions input {
    width: 96px;
  }

  .notify-detail-table-wrap {
    padding: 0 12px 16px;
  }
}

/* Mobile Sidebar Overlay Drawer (No content squashing) */
@media (max-width: 991px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 250px !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 10001 !important;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .sidebar.open {
    left: 0 !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5) !important;
  }

  /* Main content NEVER shrinks or shifts on mobile */
  .sidebar.open + .main-content,
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .sidebar-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(2px) !important;
    z-index: 10000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease, visibility 0.25s ease !important;
  }

  .sidebar-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .close-sidebar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    cursor: pointer !important;
    margin-left: auto !important;
  }

  .close-sidebar:active {
    background: rgba(255, 255, 255, 0.3) !important;
  }
}

@media (max-width: 768px) {

  .sidebar-header {
    padding: 14px 10px;
  }

  .sidebar-header h2 {
    font-size: 15px;
  }

  .sidebar-user {
    padding: 14px 10px;
    gap: 8px;
  }

  .sidebar-user .avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .sidebar-user .name {
    font-size: 10px;
  }

  .sidebar-user .role {
    font-size: 9px;
  }

  .nav-header {
    padding: 10px 12px 6px;
    font-size: 8px;
  }

  .nav-item {
    padding: 9px 12px;
    gap: 8px;
    font-size: 10px;
  }

  .nav-item i {
    width: 14px;
    font-size: 12px;
  }

  .topbar {
    height: 44px;
    padding: 0 8px;
  }

  .menu-toggle,
  .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .search-bar {
    display: flex;
    max-width: 200px;
    height: 28px;
    padding: 4px 10px;
  }

  .search-bar input {
    font-size: 10px;
  }

  .view-container {
    padding: 18px 10px;
  }

  .page-header {
    margin-bottom: 14px;
  }

  .page-title {
    font-size: 18px;
  }

  .page-subtitle {
    font-size: 11px;
  }

  .table-card,
  .form-card,
  .dashboard-card {
    border-radius: 6px;
  }

  .card-header {
    padding: 10px;
  }

  .filter-group {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
  }

  .filter-group .form-input,
  .filter-group .form-select {
    min-width: 92px;
    padding: 7px 8px;
    font-size: 10px;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 30px;
    padding: 7px 9px;
    font-size: 10px;
    white-space: nowrap;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .data-table th,
  .data-table td {
    padding: 8px 9px;
    font-size: 10px;
  }

  .data-table th {
    font-size: 8px;
  }

  .prod-thumb {
    width: 32px;
    height: 32px;
  }

  .status-badge {
    padding: 3px 7px;
    font-size: 8px;
  }
}

@media (max-width: 560px) {
  .notify-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    overflow-x: visible !important;
  }

  .notify-toolbar .filter-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #notify-search-filter {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  #notify-category-filter,
  #notify-color-filter,
  #notify-size-filter {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  #notify-search-filter::placeholder,
  #notify-category-filter::placeholder,
  #notify-color-filter::placeholder,
  #notify-size-filter::placeholder {
    font-size: 11px !important;
    opacity: 0.7;
  }

  .notify-toolbar > div:last-child {
    width: 100% !important;
    display: flex !important;
  }

  .notify-toolbar .btn-secondary {
    width: 100% !important;
    min-width: 0 !important;
    padding: 9px 14px !important;
    color: var(--text-dark) !important;
    justify-content: center !important;
    font-size: 12px !important;
  }

  .notify-toolbar .btn-secondary i {
    color: var(--text-dark);
    margin-right: 6px;
  }

  .notify-table-wrap {
    padding: 0;
    overflow-x: auto;
  }

  .notify-table {
    display: table;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
  }

  .notify-table th:nth-child(1),
  .notify-table td:nth-child(1) {
    width: 34%;
  }

  .notify-table th:nth-child(2),
  .notify-table td:nth-child(2) {
    width: 15%;
  }

  .notify-table th:nth-child(3),
  .notify-table td:nth-child(3) {
    width: 20%;
  }

  .notify-table th:nth-child(4),
  .notify-table td:nth-child(4) {
    width: 21%;
  }

  .notify-table th:nth-child(5),
  .notify-table td:nth-child(5) {
    width: 10%;
    text-align: center;
  }

  .notify-table thead {
    display: table-header-group;
  }

  .notify-table tbody {
    display: table-row-group;
    padding: 0;
  }

  .notify-table tr,
  .notify-table .notify-group-row,
  .notify-table .notify-product-row,
  .notify-product-summary-row,
  .notify-request-row {
    display: table-row;
    width: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .notify-table th,
  .notify-table td,
  .notify-table .notify-group-row td,
  .notify-table .notify-product-row td,
  .notify-product-summary-row td,
  .notify-request-row td,
  .notify-request-row td[data-label],
  .notify-product-summary-row td[data-label] {
    display: table-cell;
    width: auto;
    padding: 7px 6px;
    font-size: 8.5px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .notify-request-row td[data-label]::before,
  .notify-product-summary-row td[data-label]::before {
    content: none;
  }

  .notify-select-cell {
    position: static;
    width: auto !important;
    padding: 8px 9px !important;
  }

  .notify-product-cell {
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  .notify-product-cell img {
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px;
  }

  .notify-product-cell > div {
    min-width: 0 !important;
  }

  .notify-product-cell strong,
  .notify-product-cell div div {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Notify Me Single Page Layout (No Horizontal Scroll) */
.notify-table-wrap {
  width: 100%;
  overflow-x: hidden !important;
}

.notify-table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: auto !important;
}

.notify-table th,
.notify-table td {
  padding: 10px 10px !important;
  vertical-align: middle !important;
}

.notify-table th {
  padding: 10px 10px !important;
  white-space: nowrap !important;
}

.notify-table .notify-request-row:hover {
  background-color: #faf7ef !important;
}

@media (max-width: 768px) {
  .notify-table-wrap {
    overflow-x: auto !important;
  }
  .notify-table {
    min-width: 580px !important;
  }
}

/* Category Card Header Alignment Fix (Prevents badge/title overlap on all screen sizes) */
.cat-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 18px !important;
}

.cat-card-header .cat-card-info,
.cat-card-header > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.cat-card-header .cat-card-info > div,
.cat-card-header > div:first-child > div {
  min-width: 0 !important;
  overflow: hidden !important;
}

.cat-card-header .cat-card-actions,
.cat-card-header > div:last-child {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}

.cat-card-header .status-badge {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
}

.cat-card-header .action-btn {
  flex-shrink: 0 !important;
  width: 32px !important;
  height: 32px !important;
}

/* User Table Cell Text Truncation & Alignment */
.user-table .user-info-cell {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.user-table .user-avatar {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.user-table .user-info-cell > div {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

.user-table .user-name {
  display: block !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  color: var(--text-main) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  line-height: 1.25 !important;
}

.user-table .user-email {
  display: block !important;
  font-size: 11px !important;
  color: var(--text-muted) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  line-height: 1.2 !important;
}

/* --- ADMIN ANNOUNCEMENT PREVIEW & CONTROLS --- */
.top-announcement-ticker {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 10;
  background: #d32f2f;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1.2;
  padding: 8px 0;
  display: block;
}
.top-announcement-ticker .ticker-track {
  display: flex;
  width: max-content;
  animation: topTickerMarquee 25s linear infinite;
}
.top-announcement-ticker:hover .ticker-track {
  animation-play-state: paused;
}
.top-announcement-ticker .ticker-content {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.top-announcement-ticker .ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 32px;
  white-space: nowrap;
}
@keyframes topTickerMarquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.switch-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 20px;
  background: #ccc;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 0.3s;
}
.switch-toggle input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch-toggle input[type="checkbox"]:checked {
  background: #27ae60;
}
.switch-toggle input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}



/* Mobile Responsive Enhancements for Login & Mobile View */
@media (max-width: 600px) {
  .login-overlay {
    padding: 16px 12px !important;
  }
  .login-card {
    padding: 26px 18px !important;
    max-width: 100% !important;
    border-radius: 12px !important;
  }
  .login-logo {
    margin-bottom: 20px !important;
  }
  .login-logo h1 {
    font-size: 24px !important;
    letter-spacing: 2px !important;
  }
  .login-logo p {
    font-size: 13px !important;
  }
  .input-group {
    margin-bottom: 14px !important;
  }
  .input-group input {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom */
    padding: 13px 14px 13px 44px !important;
    min-height: 46px !important;
  }
  .input-group input[type="password"],
  .input-group input.has-toggle {
    padding-right: 48px !important;
  }
  .toggle-password-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  #admin-login-btn {
    min-height: 48px !important;
    font-size: 14px !important;
    padding: 13px !important;
    border-radius: 6px !important;
  }
}
