/* =========================================================
   SIDEBAR NAVIGATION
========================================================= */

:root {
  --sidebar-w: 268px;
  --sidebar-mini: 78px;
  --nav-blue: #172b4d;
  --nav-blue-2: #23406f;
  --nav-accent: #2563eb;
}


/* =========================================================
   BODY
========================================================= */

body {
  overflow-x: hidden;
}


/* =========================================================
   MAIN SIDEBAR
========================================================= */

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);

  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #f8fbff 100%
  );

  border-right: 1px solid #dbe3ee;

  box-shadow:
    8px 0 30px rgba(15, 23, 42, .07);

  z-index: 80;

  display: flex;
  flex-direction: column;

  transition:
    width .28s cubic-bezier(.22, 1, .36, 1),
    transform .28s ease;
}

/* Start closed; opening restores the existing sidebar design unchanged. */
.app-sidebar.is-closed { transform: translateX(-102%); }

.sidebar-open-button {
  position: fixed; top: 14px; left: 14px; z-index: 81;
  width: 38px; height: 38px; border: 1px solid #dbe3ee;
  border-radius: 10px; background: #fff; color: #475569;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}
.sidebar-open-button:hover { background: #eef4ff; color: #2563eb; }
.app-sidebar:not(.is-closed) + .sidebar-open-button { display: none; }


/* =========================================================
   TOP BRAND AREA
========================================================= */

.sidebar-brand {
  position: relative;

  height: 92px;
  min-height: 92px;

  display: flex;
  align-items: center;

  gap: 12px;

  padding: 14px 14px;

  border-bottom: 1px solid #e5eaf1;

  background: #ffffff;

  box-sizing: border-box;

  overflow: hidden;
}


/* =========================================================
   LOGO
========================================================= */

.sidebar-logo {
  width: 54px;
  height: 54px;

  flex: 0 0 54px;

  border: 1px solid #dbe3ee;
  border-radius: 16px;

  background: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  box-shadow:
    0 4px 14px rgba(15, 23, 42, .06);
}

.sidebar-logo img {
  width: 100%;
  height: 100%;

  object-fit: contain;

  padding: 3px;

  box-sizing: border-box;
}


/* =========================================================
   BRAND TEXT
========================================================= */

.sidebar-brand-text {
  flex: 1 1 auto;
  min-width: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;

  overflow: hidden;

  transition:
    opacity .2s ease,
    transform .2s ease;
}

.sidebar-brand-text strong {
  display: block;

  color: #0f172a;

  font-size: 19px;
  line-height: 23px;

  font-weight: 900;

  white-space: nowrap;

  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-text span {
  display: block;

  color: #64748b;

  font-size: 10px;
  line-height: 15px;

  font-weight: 700;

  white-space: nowrap;

  overflow: hidden;
  text-overflow: ellipsis;

  margin-top: 2px;
}


/* =========================================================
   COLLAPSE BUTTON
   OPEN STATE

   Button top brand area ke right side mein rahega.
   HTML mein button sidebar-scroll ke andar hone ke
   bawajood fixed position se brand ke same top area
   mein dikhega.
========================================================= */

.sidebar-collapse {
  position: fixed;

  top: 3px;

  left: calc(var(--sidebar-w) - 48px);

  width: 38px;
  min-width: 38px;

  height: 38px;
  min-height: 38px;

  padding: 0;
  margin: 0;

  border: 1px solid #dbe3ee;

  background: #f8fafc;

  border-radius: 10px;

  color: #64748b;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  z-index: 100;

  transition:
    background .2s ease,
    color .2s ease,
    border-color .2s ease,
    transform .2s ease;
}

.sidebar-collapse:hover {
  background: #eef4ff;

  color: #2563eb;

  border-color: #bfdbfe;
}

.sidebar-collapse:active {
  transform: scale(.94);
}

.sidebar-collapse .material-symbols-outlined {
  font-size: 21px !important;

  line-height: 1;

  transition:
    transform .28s ease;
}


/* =========================================================
   SIDEBAR SCROLL
========================================================= */

.sidebar-scroll {
  flex: 1;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 15px 10px 18px;

  position: relative;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;

  border-radius: 10px;
}


/* =========================================================
   NAV LABEL
========================================================= */

.nav-label {
  padding: 8px 12px 6px;

  color: #94a3b8;

  font-size: 10px;

  font-weight: 900;

  letter-spacing: .12em;

  text-transform: uppercase;

  white-space: nowrap;
}


/* =========================================================
   NAV GROUP
========================================================= */

.nav-group {
  margin-bottom: 10px;
}


/* =========================================================
   NAV ITEM
========================================================= */

.nav-item {
  position: relative;

  display: flex;
  align-items: center;

  gap: 12px;

  width: 100%;

  min-height: 43px;

  padding: 9px 11px;

  border-radius: 11px;

  color: #475569;

  text-decoration: none;

  font-size: 12px;

  font-weight: 700;

  box-sizing: border-box;

  transition:
    background .2s ease,
    color .2s ease,
    transform .2s ease;
}

.nav-item .nav-icon {
  width: 22px;
  min-width: 22px;

  text-align: center;

  font-size: 20px !important;

  color: #64748b;

  transition:
    transform .2s ease,
    color .2s ease;
}

.nav-item:hover {
  background: #eef4ff;

  color: #1d4ed8;

  transform: translateX(2px);
}

.nav-item:hover .nav-icon {
  color: #2563eb;

  transform: scale(1.08);
}

.nav-item.active {
  background: linear-gradient(
    90deg,
    #eaf2ff,
    #f3f7ff
  );

  color: #1d4ed8;

  box-shadow:
    inset 3px 0 0 #2563eb;
}

.nav-item.active .nav-icon {
  color: #2563eb;
}


/* =========================================================
   NAV BADGE
========================================================= */

.nav-badge {
  margin-left: auto;

  min-width: 21px;

  height: 20px;

  padding: 0 6px;

  border-radius: 999px;

  background: #eef2f7;

  color: #64748b;

  font-size: 9px;

  font-weight: 900;

  display: flex;
  align-items: center;
  justify-content: center;
}


/* =========================================================
   FOOTER
========================================================= */

.sidebar-footer {
  display: none !important;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.app-content {
  margin-left: var(--sidebar-w);

  min-height: 100vh;

  transition:
    margin-left .28s cubic-bezier(.22, 1, .36, 1);
}


/* =========================================================
   COLLAPSED SIDEBAR
========================================================= */

.app-sidebar.is-collapsed {
  width: var(--sidebar-mini);
}


/* =========================================================
   COLLAPSED BRAND
========================================================= */

.app-sidebar.is-collapsed .sidebar-brand {
  height: 92px;

  min-height: 92px;

  padding: 10px;

  justify-content: center;

  gap: 0;
}


/* =========================================================
   HIDE BRAND TEXT
========================================================= */

.app-sidebar.is-collapsed .sidebar-brand-text {
  display: none;
}


/* =========================================================
   COLLAPSED LOGO
========================================================= */

.app-sidebar.is-collapsed .sidebar-logo {
  width: 54px;

  min-width: 54px;

  height: 54px;
}


/* =========================================================
   COLLAPSED BUTTON AREA
========================================================= */

.app-sidebar.is-collapsed .sidebar-scroll {
  padding-top: 10px;
}


/* =========================================================
   COLLAPSED BUTTON

   Ab button Admin Overview ke UPAR rahega.
========================================================= */

.app-sidebar.is-collapsed .sidebar-collapse {
  position: relative;

  top: auto;
  left: auto;

  width: 44px;

  min-width: 44px;

  height: 38px;

  min-height: 38px;

  margin: 0 auto 10px;

  padding: 0;

  border-radius: 10px;

  background: #f8fafc;

  display: flex;

  z-index: 1;
}


/* =========================================================
   COLLAPSED ICON
========================================================= */

.app-sidebar.is-collapsed
.sidebar-collapse
.material-symbols-outlined {

  font-size: 20px !important;

  transform: rotate(180deg);
}


/* =========================================================
   HIDE LABELS / TEXT
========================================================= */

.app-sidebar.is-collapsed .nav-label,
.app-sidebar.is-collapsed .nav-item .nav-text,
.app-sidebar.is-collapsed .nav-badge {
  display: none;
}


/* =========================================================
   CENTER NAV ICONS
========================================================= */

.app-sidebar.is-collapsed .nav-item {
  justify-content: center;

  padding: 10px 0;
}

.app-sidebar.is-collapsed .nav-item .nav-icon {
  margin: 0;

  width: 22px;

  min-width: 22px;
}

.app-sidebar.is-collapsed .nav-item:hover {
  transform: none;
}


/* =========================================================
   MAIN CONTENT WHEN SIDEBAR COLLAPSED
========================================================= */

body.sidebar-collapsed .app-content {
  margin-left: var(--sidebar-mini);
}


/* =========================================================
   SIDEBAR OVERLAY
========================================================= */

.sidebar-overlay {
  display: none;

  position: fixed;

  inset: 0;

  background:
    rgba(15, 23, 42, .42);

  backdrop-filter: blur(2px);

  z-index: 70;

  opacity: 0;

  transition:
    opacity .25s;
}

.sidebar-overlay.show {
  display: block;

  opacity: 1;
}


/* =========================================================
   MOBILE MENU BUTTON
========================================================= */

.mobile-menu-btn {
  display: none;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {

  .app-sidebar {
    width: 286px;

    transform: translateX(-102%);

    box-shadow:
      18px 0 40px rgba(15, 23, 42, .2);
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-sidebar.is-closed.mobile-open { transform: translateX(0); }

  .app-sidebar.is-collapsed {
    width: 286px;
  }

  .app-sidebar.is-collapsed .sidebar-brand {
    height: 92px;

    justify-content: flex-start;

    padding: 14px;
  }

  .app-sidebar.is-collapsed .sidebar-brand-text {
    display: flex;
  }

  .app-sidebar.is-collapsed .sidebar-collapse {
    position: absolute;

    top: 26px;

    left: auto;

    right: 10px;

    width: 38px;

    min-width: 38px;

    height: 38px;

    min-height: 38px;

    margin: 0;

    border-radius: 10px;
  }

  .app-sidebar.is-collapsed
  .sidebar-collapse
  .material-symbols-outlined {

    transform: none;
  }

  .app-content {
    margin-left: 0;
  }

  body.sidebar-collapsed .app-content {
    margin-left: 0;
  }

  .sidebar-collapse {
    display: flex;
  }

  .mobile-menu-btn {
    display: flex;

    width: 40px;

    height: 40px;

    align-items: center;

    justify-content: center;

    border: 1px solid #dbe3ee;

    background: #fff;

    border-radius: 11px;

    color: #475569;

    cursor: pointer;

    flex: 0 0 40px;
  }

  .mobile-menu-btn:hover {
    background: #f1f5f9;

    color: #2563eb;
  }

  header .max-w-6xl {
    gap: 10px;
  }

  header .max-w-6xl > .flex-1 {
    min-width: 0;
  }

  header h1 {
    font-size: 14px;
  }

  header #headerStatusPill {
    margin-left: auto;
  }

  main {
    padding-left: 12px !important;

    padding-right: 12px !important;
  }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 560px) {

  .sidebar-brand {
    height: 70px;

    min-height: 70px;
  }

  header .max-w-6xl {
    padding-top: 10px !important;

    padding-bottom: 10px !important;
  }

  header .size-10 {
    width: 36px;

    height: 36px;
  }

  header .size-10 + .flex-1 p {
    display: none;
  }

  #headerStatusPill {
    padding: 6px 9px !important;
  }

  #headerStatusPill .text-xs {
    font-size: 9px;
  }

  #connectionBanner {
    padding: 14px !important;
  }

  #connectionBanner .size-14 {
    width: 46px;

    height: 46px;
  }

  #connectionBanner .flex.gap-2 {
    width: 100%;
  }

  #connectionBanner button {
    flex: 1;

    justify-content: center;

    padding-left: 10px !important;

    padding-right: 10px !important;
  }
}


/* =========================================================
   MATERIAL SYMBOLS
========================================================= */

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'liga';
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}
.dispatch-truck {
    transform: scaleX(-1);
}
