/* ============================================
   LAKSHERA ADMIN — APP SHELL (sidebar + topbar)
   Shared across dashboard, products, billing, profile
   ============================================ */

body.app-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--aubergine) 0%, #230030 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-top {
  padding: 28px 24px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-top .brand-mark { display: flex; align-items: center; gap: 11px; }
.sidebar-top .mark-badge {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  color: var(--aubergine); font-family: var(--font-display); font-weight: 700; font-size: 19px;
}
.sidebar-top .brand-logo-img {
  height: 46px;
  width: 46px;
  object-fit:contain;
  border-radius: 50%;
  border: 2px solid var(--gold-light);
  background:none;
  padding: 3px;
  flex-shrink: 0;
}

.sidebar-top .brand-text-img {
  height: 19px;
  width: auto;
  object-fit: contain;
}

.sidebar-top .brand-tag {
  display: block;
  text-align: center;
  margin-top: 1px;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
body.sidebar-collapsed .sidebar-top .brand-tag { display: none; }

.sidebar-nav {
  flex: 1;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-section-label {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link i { width: 18px; text-align: center; font-size: 15px; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-link.active {
  background: rgba(201,151,74,0.16);
  color: var(--gold-light);
  font-weight: 600;
}
.nav-link .badge-count {
  margin-left: auto;
  background: var(--gold-dark);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-bottom {
  padding: 16px 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-bottom .nav-link.logout:hover { background: rgba(192,57,43,0.18); color: #ff9f92; }

/* ---------- Main area ---------- */
.dashboard-main {
  margin-left: 248px;
  flex: 1;
  min-width: 0;
  padding: 30px 38px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.menu-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  display: none;
  align-items: center; justify-content: center;
  background: var(--white); border: 1px solid var(--border);
  color: var(--aubergine); font-size: 15px; flex-shrink: 0;
}
.menu-toggle:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ---------- Top search ---------- */
.topbar-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.topbar-search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,151,74,0.14);
}
.topbar-search i { color: var(--ink-soft); font-size: 14px; }
.topbar-search input {
  border: none; outline: none; flex: 1;
  font-size: 13.5px; color: var(--ink); background: transparent;
}
.topbar-search input::placeholder { color: var(--ink-soft); }

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 60;
  max-height: 300px;
  overflow-y: auto;
}
.search-results.show { display: block; }
.search-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink);
}
.search-result-row:hover { background: var(--aubergine-pale); }
.search-result-row i { color: var(--gold-dark); width: 16px; text-align: center; }
.search-result-row span { flex: 1; }
.search-result-row small { color: var(--ink-soft); font-size: 10.5px; }
.search-result-empty {
  padding: 14px 10px; font-size: 12.5px; color: var(--ink-soft); text-align: center;
}

/* ---------- Notification bell ---------- */
.notif-wrap { position: relative; }
.notif-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1px solid var(--border);
  color: var(--aubergine); font-size: 15px;
}
.notif-btn:hover { border-color: var(--gold); color: var(--gold-dark); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 20px;
  background: var(--danger);
  color: var(--white);
  font-size: 10px; font-weight: 700;
  display: none;
  align-items: center; justify-content: center;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  z-index: 60;
  overflow: hidden;
}
.notif-dropdown.show { display: block; }
.notif-dropdown-head {
  padding: 14px 16px;
  font-size: 12.5px; font-weight: 700; color: var(--aubergine);
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--ink);
  border-top: 1px solid var(--border);
  position: relative;
}
.notif-item:first-of-type { border-top: none; }
.notif-item i { color: var(--gold-dark); margin-top: 2px; }
.notif-item.notif-empty { color: var(--ink-soft); justify-content: center; text-align: center; }
.notif-item:hover { background: var(--aubergine-pale); }
.notif-item.unread { background: rgba(201,151,74,0.06); font-weight: 500; }
.notif-item.unread::after {
  content: "";
  position: absolute;
  top: 16px; right: 14px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold-dark);
}
.notif-dropdown-viewall {
  display: block;
  text-align: center;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-dark);
  border-top: 1px solid var(--border);
}
.notif-dropdown-viewall:hover { background: var(--aubergine-pale); }

.chip-caret { font-size: 10px; color: var(--ink-soft); margin-left: 2px; }

/* Manual sidebar collapse (menu toggle) */
body.sidebar-collapsed .sidebar { width: 76px; }
body.sidebar-collapsed .sidebar-top .brand-text-img,
body.sidebar-collapsed .nav-link span,
body.sidebar-collapsed .nav-section-label { display: none; }
body.sidebar-collapsed .sidebar-top { padding: 24px 0; display: flex; justify-content: center; }
body.sidebar-collapsed .sidebar-top .brand-mark { flex-direction: column; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 12px; }
body.sidebar-collapsed .nav-link .badge-count { display: none; }
body.sidebar-collapsed .dashboard-main { margin-left: 76px; }
body.sidebar-collapsed .sidebar-top .brand-logo-img { height: 36px; width: 36px; }

.topbar .tag {
  font-size: 12px;
  color: var(--gold-dark);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.topbar h1 {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--aubergine);
  margin-top: 4px;
  font-weight: 600;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.date-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 500;
}
.date-chip i { color: var(--gold-dark); }
.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 6px 14px 6px 6px;
  border-radius: 30px;
}
.profile-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: var(--aubergine);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; font-family: var(--font-display);
}
.profile-chip b { display: block; font-size: 12.5px; color: var(--aubergine); }
.profile-chip small { font-size: 10.5px; color: var(--ink-soft); }

@media (max-width: 980px) {
  .sidebar { width: 76px; }
  .sidebar-top .brand-text-img, .sidebar-top .brand-tag, .nav-link span, .nav-section-label { display: none; }
  .sidebar-top { padding: 24px 0; display: flex; justify-content: center; }
  .sidebar-top .brand-mark { flex-direction: column; }
  .nav-link { justify-content: center; padding: 12px; }
  .nav-link .badge-count { display: none; }
  .dashboard-main { margin-left: 76px; padding: 24px 20px 50px; }
  .sidebar-top .brand-logo-img { height: 36px; width: 36px; }
  .menu-toggle { display: flex; }
}
@media (max-width: 640px) {
  .topbar-right .date-chip { display: none; }
  .topbar-search { order: 3; flex-basis: 100%; max-width: none; }
}