/* ==========================================================================
   Smart Menu — Modern Dashboard UX (Collapsible Sidebar, Mobile Drawer & All-Menus Hub)
   ========================================================================== */

/* Top-header Mobile Hamburger Button (next to Logo) */
.sm-mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  font-size: 20px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  flex-shrink: 0;
}
.sm-mobile-menu-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #2563eb;
}
#header .left-side {
  display: flex;
  align-items: center;
}

/* Desktop Floating Circular Sidebar Toggle (straddling the right border) */
.sm-sidebar-collapse-btn {
  position: absolute;
  top: 12px;
  right: -14px;
  z-index: 45;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.sm-sidebar-collapse-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.sm-sidebar-collapse-btn i {
  font-size: 14px;
  line-height: 1;
  transition: transform 0.22s ease;
}

/* Mobile Drawer Header (hidden on Desktop) */
.sm-drawer-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.sm-drawer-mobile-head strong {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.sm-drawer-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sm-drawer-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

/* Drawer Backdrop */
#sm-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99980;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}
#sm-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Desktop Collapsible Mini-Sidebar (>= 1100px) */
@media (min-width: 1100px) {
  .dashboard-sidebar {
    position: relative;
    overflow: visible !important;
    transition:
      flex-basis 0.24s ease,
      width 0.24s ease,
      min-width 0.24s ease;
  }
  body.sm-sidebar-collapsed .dashboard-sidebar {
    flex: 0 0 72px !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
  }
  body.sm-sidebar-collapsed .sm-sidebar-collapse-btn i {
    transform: rotate(180deg);
  }
  body.sm-sidebar-collapsed .dashboard-nav ul::before {
    content: "" !important;
    display: block !important;
    height: 1px !important;
    margin: 8px 14px !important;
    padding: 0 !important;
    background: #e2e8f0 !important;
    font-size: 0 !important;
  }
  body.sm-sidebar-collapsed .dashboard-nav ul li a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 11px 0 !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-align: center;
  }
  body.sm-sidebar-collapsed .dashboard-nav ul li a i {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }
  body.sm-sidebar-collapsed .dashboard-nav ul li a small,
  body.sm-sidebar-collapsed .dashboard-nav ul li a .blink_me {
    display: none !important;
  }
}

/* Floating Tooltip for Collapsed Desktop Sidebar */
#sm-sidebar-tooltip {
  position: fixed;
  z-index: 99999;
  background: #0f172a;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}
#sm-sidebar-tooltip.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Mobile / Tablet Slide-in Left Off-Canvas Drawer (<= 1099px) */
@media (max-width: 1099px) {
  body.sm-has-sidebar .sm-mobile-menu-btn {
    display: inline-flex;
  }
  .sm-sidebar-collapse-btn {
    display: none !important;
  }
  .dashboard-responsive-nav-trigger {
    display: none !important;
  }
  .dashboard-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 285px !important;
    max-width: 84vw !important;
    height: 100vh !important;
    z-index: 99990 !important;
    background: #ffffff !important;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.22) !important;
    transform: translateX(-105%) !important;
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  body.sm-drawer-open .dashboard-sidebar {
    transform: translateX(0) !important;
  }
  .sm-drawer-mobile-head {
    display: flex !important;
    flex-shrink: 0;
  }
  .dashboard-sidebar .dashboard-sidebar-inner {
    height: calc(100vh - 62px) !important;
    overflow-y: auto !important;
    padding: 0 !important;
  }
  .dashboard-sidebar .dashboard-nav-container {
    padding: 0 !important;
  }
  .dashboard-sidebar .dashboard-nav-inner {
    padding: 10px 0 36px !important;
    margin: 0 !important;
  }
  .dashboard-sidebar .dashboard-nav {
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .dashboard-sidebar .dashboard-nav ul {
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    display: block !important;
  }
  body.sm-drawer-open {
    overflow: hidden;
  }
}
@media (max-width: 520px) {
  #header #logo img {
    max-height: 28px !important;
    width: auto !important;
  }
  .sm-mobile-menu-btn {
    width: 36px;
    height: 36px;
    margin-right: 8px;
  }
}

/* ==========================================================================
   All-Menus Shortcut Hub Page (/all-menus)
   ========================================================================== */
.sm-hub-search-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.sm-hub-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.sm-hub-search-wrap i {
  position: absolute;
  left: 15px;
  font-size: 18px;
  color: #64748b;
  pointer-events: none;
}
.sm-hub-search-input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 44px !important;
  border-radius: 10px !important;
  border: 1.5px solid #cbd5e1 !important;
  background: #f8fafc !important;
  font-size: 15px !important;
  color: #0f172a !important;
  margin: 0 !important;
  box-shadow: none !important;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.sm-hub-search-input:focus {
  border-color: #2563eb !important;
  background: #ffffff !important;
}
.sm-hub-clear-btn {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.sm-hub-clear-btn.show {
  display: inline-flex;
}
.sm-hub-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sm-hub-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sm-hub-pill:hover {
  border-color: #93c5fd;
  color: #2563eb;
}
.sm-hub-pill.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}
.sm-hub-group {
  margin-bottom: 24px;
}
.sm-hub-group-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sm-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1180px) {
  .sm-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .sm-hub-grid {
    grid-template-columns: 1fr;
  }
}
.sm-hub-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  text-decoration: none !important;
  color: inherit;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}
.sm-hub-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
}
.sm-hub-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}
.sm-ic-blue {
  background: #eff6ff;
  color: #2563eb;
}
.sm-ic-indigo {
  background: #eef2ff;
  color: #4f46e5;
}
.sm-ic-green {
  background: #ecfdf5;
  color: #059669;
}
.sm-ic-amber {
  background: #fffbeb;
  color: #d97706;
}
.sm-ic-rose {
  background: #fff1f2;
  color: #e11d48;
}
.sm-ic-cyan {
  background: #ecfeff;
  color: #0891b2;
}
.sm-ic-slate {
  background: #f1f5f9;
  color: #475569;
}
.sm-hub-card-body {
  min-width: 0;
  flex: 1;
}
.sm-hub-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sm-hub-card-desc {
  font-size: 12.8px;
  color: #64748b;
  line-height: 1.48;
  margin: 0;
}
.sm-hub-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
}
.sm-hub-empty {
  display: none;
  text-align: center;
  padding: 44px 20px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
}
