/* ============================================================
   Unified Sidebar Navigation — Monokel Dashboard
   ============================================================ */

/* Layout wrapper */
.usb-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.usb-sidebar {
  width: 220px;
  background: #31342a;
  color: white;
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  font-family: 'Futura', system-ui, -apple-system, sans-serif;
}

/* Main content area */
.usb-main {
  flex: 1;
  margin-left: 220px;
  padding: 24px;
  background: #f6f1ea;
  min-height: 100vh;
  max-width: calc(100vw - 220px);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Header */
.usb-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0;
}
.usb-header h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  margin: 0;
}
.usb-header p {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 4px 0 0;
}

/* Store / Tailor Selects */
.usb-store-select {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
}
.usb-store-select select {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: white;
  font-family: 'Futura', system-ui, sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  -webkit-appearance: none;
  outline: none;
  margin-bottom: 6px;
}
.usb-store-select select:last-child { margin-bottom: 0; }
.usb-store-select select option {
  background: #31342a;
  color: white;
}

/* Section labels */
.usb-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  padding: 16px 20px 6px;
}

/* Nav items */
.usb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 0 8px 2px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-family: 'Futura', system-ui, sans-serif;
}
.usb-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}
.usb-item.active {
  background: rgba(255,255,255,0.12);
  color: white;
  font-weight: 600;
  border-left-color: #f6f1ea;
}

/* Nav icons */
.usb-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}
.usb-item.active .usb-icon { opacity: 1; }

/* Sidebar footer */
.usb-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}
.usb-footer-stat {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
}
.usb-footer-stat strong {
  color: rgba(255,255,255,0.85);
}

/* Logout link */
.usb-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 8px 8px 0;
  border-radius: 8px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  font-family: 'Futura', system-ui, sans-serif;
}
.usb-logout:hover {
  color: #fca5a5;
  background: rgba(220,38,38,0.08);
}
.usb-logout svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Search box in sidebar */
.usb-search {
  padding: 8px 16px 0;
  margin-bottom: 4px;
}
.usb-search input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 0.8rem;
  font-family: 'Futura', system-ui, sans-serif;
  outline: none;
  box-sizing: border-box;
}
.usb-search input::placeholder { color: rgba(255,255,255,0.35); }
.usb-search input:focus { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.12); }
.usb-search-wrap { position: relative; }
.usb-search-wrap svg {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: rgba(255,255,255,0.4); pointer-events: none;
}
.usb-search-results {
  display: none;
  position: fixed;
  left: 220px;
  top: 0;
  width: 380px;
  max-height: 80vh;
  background: white;
  border-radius: 0 0 12px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  overflow-y: auto;
  z-index: 100;
  font-family: 'Futura', system-ui, sans-serif;
}

/* ---- Mobile Hamburger ---- */
.usb-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 50;
  background: #31342a;
  color: white;
  border: none;
  border-radius: 8px;
  width: 40px; height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 35;
}
.sidebar-overlay.open { display: block; }

/* ---- Responsive: < 1024px ---- */
@media (max-width: 1024px) {
  .usb-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    z-index: 60;
  }
  .usb-sidebar.open { transform: translateX(0); }

  .usb-main {
    margin-left: 0;
    padding: 12px;
    padding-top: 56px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .usb-toggle { display: flex; }
  .sidebar-overlay.open { display: block; }

  .usb-search-results {
    left: 0;
    width: 100vw;
    max-width: 100vw;
    border-radius: 0 0 12px 12px;
  }
}

/* ---- Print ---- */
@media print {
  .usb-sidebar { display: none !important; }
  .usb-main { margin-left: 0 !important; padding: 0 !important; }
  .usb-toggle { display: none !important; }
  .sidebar-overlay { display: none !important; }
}

/* ---- Small phones (< 400px) ---- */
@media (max-width: 400px) {
  .usb-main { padding: 8px !important; padding-top: 56px !important; }
}
