
/* Bricks & Pieces Multi-Theme Stylesheet */
:root {
  /* Default: Option A (Electric Teal & Obsidian) */
  --bg-main: #07090e;
  --bg-card: #111622;
  --bg-card-hover: #172033;
  --bg-sidebar: #0b0f19;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #06b6d4;
  --primary-hover: #0891b2;
  --primary-glow: rgba(6, 182, 212, 0.25);
  --accent: #14b8a6;
  --sale-bg: #0f766e;
  --sale-text: #2dd4bf;
  --border: #1e293b;
  --radius: 12px;
}

/* Option B: Classic Lego Red, Yellow & Black */
[data-theme="lego"] {
  --bg-main: #0c0c0e;
  --bg-card: #16161b;
  --bg-card-hover: #23232c;
  --bg-sidebar: #101014;
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --primary: #e52521;
  --primary-hover: #c41814;
  --primary-glow: rgba(229, 37, 33, 0.35);
  --accent: #ffcf00;
  --sale-bg: #e52521;
  --sale-text: #ffffff;
  --border: #272732;
}

/* Option C: Hybrid Builder (Electric Teal + Lego Red & Yellow Accents) */
[data-theme="hybrid"] {
  --bg-main: #080c14;
  --bg-card: #121927;
  --bg-card-hover: #1a2538;
  --bg-sidebar: #0c121e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #06b6d4;
  --primary-hover: #0891b2;
  --primary-glow: rgba(6, 182, 212, 0.3);
  --accent: #ffcf00;
  --sale-bg: #e52521;
  --sale-text: #ffcf00;
  --border: #223049;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary-hover); }

/* ==================== BRAND BARS ==================== */
/* 1. Header Brand Bar above Product Details */
.product-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.12) 0%, rgba(17, 22, 34, 0.95) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.brand-bar-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.brand-bar-badge {
  background: var(--primary);
  color: #07090e;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  box-shadow: 0 0 10px var(--primary-glow);
}
.brand-bar-part {
  font-family: monospace;
  font-size: 0.95rem;
  color: #f8fafc;
  font-weight: 600;
}
.brand-bar-dot {
  color: var(--text-muted);
}
.brand-bar-cat {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.brand-bar-action {
  margin-left: auto;
}
.brand-bar-link {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.brand-bar-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* 2. Brand Bar above Each Product Card & Sale Card */
.card-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  background: linear-gradient(135deg, #162032 0%, #0d1424 100%);
  border-top: 3px solid var(--primary);
  border-bottom: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 0.75rem;
  position: relative;
  z-index: 2;
  transition: all 0.2s ease;
}

.product-card:hover .card-brand-bar,
.sale-card:hover .card-brand-bar {
  border-top-color: var(--accent);
  background: linear-gradient(135deg, #1a273e 0%, #0f182c 100%);
  border-bottom-color: rgba(6, 182, 212, 0.4);
}

.card-brand-name {
  background: var(--primary);
  color: #07090e;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 0 12px var(--primary-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover .card-brand-name,
.sale-card:hover .card-brand-name {
  transform: scale(1.03);
  box-shadow: 0 0 16px var(--primary-glow);
}

.card-brand-part {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

/* Ensure sale-card brand bar spans full width flush across top */
.sale-card .card-brand-bar {
  margin: -1.25rem -1.25rem 0.75rem -1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Navigation */
.navbar {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 1.25rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.btn-admin {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #fff !important;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
}
.btn-admin:hover { border-color: var(--primary); }

/* Layout Container */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* ==================== HERO CAROUSEL ==================== */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-bottom: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.carousel-slide {
  min-width: 100%;
  padding: 3.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-sizing: border-box;
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.08), transparent 70%);
}
[data-theme="lego"] .carousel-slide {
  background: radial-gradient(circle at top right, rgba(229, 37, 33, 0.12), transparent 70%);
}
.slide-content { max-width: 580px; }
.slide-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.slide-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: #fff;
}
.slide-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.slide-img-wrap {
  width: 260px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6));
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}
.carousel-btn:hover {
  background: var(--primary);
  color: #0b1120;
  border-color: var(--primary);
}
.carousel-btn.prev { left: 15px; }
.carousel-btn.next { right: 15px; }

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}
.carousel-dot.active {
  width: 24px;
  border-radius: 9999px;
  background: var(--primary);
}

/* ==================== ON SALE & FEATURED DEALS ==================== */
.sale-section {
  margin-bottom: 3rem;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}
.sale-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.sale-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}
.badge-sale {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--sale-bg);
  color: var(--sale-text);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.price-strike {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-right: 0.35rem;
}
.price-sale {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

/* Search Bar */
.search-bar {
  margin: 1.5rem auto;
  max-width: 650px;
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 1rem;
  outline: none;
}
.search-bar button {
  background: var(--primary);
  border: none;
  color: #0b1120;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-bar button:hover { background: var(--primary-hover); }

/* Brand Selector Pills */
.brand-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.brand-pill {
  padding: 0.4rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.brand-pill.active, .brand-pill:hover {
  background: var(--primary);
  color: #0b1120;
  font-weight: 700;
  border-color: var(--primary);
}

/* Product Cards Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--primary);
}
.card-img-wrap {
  width: 100%;
  height: 180px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}
.card-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.badge-brand {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--primary);
  font-weight: 700;
}
.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-part-num { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }
.card-title { font-size: 1.05rem; font-weight: 600; margin: 0.25rem 0 0.75rem; color: #fff; }
.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.card-price { font-size: 1.15rem; font-weight: 700; color: #34d399; }
.stock-tag { font-size: 0.8rem; color: var(--text-muted); }
.stock-tag.in-stock { color: var(--primary); }

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.15s ease;
}
.btn-primary { background: var(--primary); color: #0b1120; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border); color: #fff; }
.btn-secondary:hover { border-color: var(--primary); }
.btn-danger { background: #ef4444; color: #fff; }

/* Admin UI */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
}
.stat-card .label { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .val { font-size: 1.85rem; font-weight: 700; margin-top: 0.35rem; color: #fff; }

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th, td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
th {
  background: var(--bg-sidebar);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
}
tr:hover { background: rgba(255, 255, 255, 0.02); }

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: #fff;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}

/* ==================== MULTI-COMPETITOR PRICE MENU & INTELLIGENCE ==================== */
.comp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.comp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  background: #111622;
}
.comp-btn:hover {
  filter: brightness(1.2);
}
.comp-cheaper {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}
.comp-higher {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.comp-match {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.comp-unset {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}
.comp-none {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.comp-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  width: 290px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  margin-top: 4px;
  overflow: hidden;
  text-align: left;
}
.comp-menu-header {
  padding: 0.65rem 0.85rem;
  background: #1e293b;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #fff;
}
.comp-menu-list {
  padding: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.comp-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  background: #111622;
  font-size: 0.8rem;
}
.comp-menu-item:hover {
  background: #172033;
}
.comp-link {
  font-weight: 700;
  color: #38bdf8;
}
.comp-link:hover { text-decoration: underline; }
.comp-stock-status {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.comp-price {
  font-weight: 700;
  color: #fff;
}
.comp-diff {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
}
.text-green { color: #34d399; }
.text-red { color: #f87171; }
.comp-menu-footer {
  padding: 0.5rem;
  background: #1e293b;
  border-top: 1px solid var(--border);
}

.comp-quick-bar {
  background: #0b0f19;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
}
.comp-rate-pill {
  background: #111622;
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.comp-rate-pill strong { color: #fff; }
.comp-action-btn {
  background: #1e293b;
  border: 1px solid var(--border);
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.comp-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Dual-Tier Photo Gallery Styles */
.photo-tier-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.tier-mfg {
  background: rgba(6, 182, 212, 0.15);
  color: var(--primary);
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.tier-own {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

/* ==================== ADMIN LEFT-HAND NAV & COLLAPSIBLE LAYOUT ==================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-main);
  position: relative;
}

/* Sidebar Styles */
.admin-sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  height: 64px;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-brand-icon {
  font-size: 1.4rem;
}

.sidebar-brand-text {
  color: var(--accent);
  transition: opacity 0.2s ease;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.sidebar-close-btn:hover { color: #fff; }

.sidebar-menu {
  flex: 1;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.75rem 0.65rem 0.35rem;
  white-space: nowrap;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: var(--bg-card);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(6, 182, 212, 0.12);
  color: var(--primary);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.sidebar-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-logout-btn {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.admin-topbar {
  height: 64px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.sidebar-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.admin-breadcrumb strong {
  color: #fff;
}

.btn-storefront-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-storefront-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-content {
  flex: 1;
  padding: 2rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

/* ==================== COLLAPSED DESKTOP STATE ==================== */
@media (min-width: 769px) {
  .admin-layout.sidebar-collapsed .admin-sidebar {
    width: 68px;
  }
  .admin-layout.sidebar-collapsed .sidebar-brand-text,
  .admin-layout.sidebar-collapsed .sidebar-text,
  .admin-layout.sidebar-collapsed .sidebar-section-label,
  .admin-layout.sidebar-collapsed .user-info {
    display: none;
  }
  .admin-layout.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 1.25rem 0.5rem;
  }
  .admin-layout.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.65rem 0;
  }
  .admin-layout.sidebar-collapsed .sidebar-footer {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  .admin-layout.sidebar-collapsed .sidebar-logout-btn {
    padding: 0.35rem;
  }
}

/* ==================== MOBILE OFF-CANVAS COLLAPSIBLE STATE ==================== */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(0);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.7);
  }
  .sidebar-close-btn {
    display: block;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    z-index: 999;
  }
  /* On mobile, when sidebar-collapsed is active, sidebar is hidden off-screen */
  .admin-layout.sidebar-collapsed .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-layout:not(.sidebar-collapsed) .sidebar-backdrop {
    display: block;
  }
}

footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}
