/* ==========================================================================
   Custom additions for the Laravel rebuild — cart/account nav utility area
   and admin panel mobile responsiveness. Kept separate from the original
   template stylesheets so template updates aren't clobbered.
   ========================================================================== */

/* ── Prevent nav labels from wrapping onto two lines ("About" / "Us") ──
   The flex items in .site-nav can shrink below their content's natural
   width by default, which lets multi-word labels break mid-phrase. Force
   single-line labels; the medium-desktop breakpoint below compensates by
   shrinking font/padding enough that everything still fits in one row. */
.site-nav__link,
.site-nav__submenu-toggle,
.site-nav__submenu-toggle span {
  white-space: nowrap;
}

/* ── Header utility group (cart + login/logout), sits before the Book Test CTA ──
   Icon-only on desktop by design: the template's own header.css already tunes
   two dedicated breakpoints (992-1199px, 1200-1399px) to fit its 7 nav items +
   1 CTA without wrapping. Adding full-width text buttons here would blow that
   budget and crowd/wrap the row, so utility actions stay compact icons with
   the text label revealed only in the mobile drawer (see below). */
.site-nav__utility {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.site-nav__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background-color: transparent;
  color: var(--color-text);
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.site-nav__icon-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background-color: rgba(46, 49, 146, 0.05);
}

.site-nav__icon-btn-label {
  display: none;
}

.site-nav__cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 0.65rem;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
}

.site-nav__logout-form {
  margin: 0;
}

@media (max-width: 991.98px) {
  .site-nav__utility {
    width: 100%;
    margin-left: 0;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .site-nav__icon-btn {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
  }

  .site-nav__icon-btn-label {
    display: inline;
  }

  .site-nav__cart-count {
    position: static;
    margin-left: auto;
  }

  .site-nav__logout-form {
    width: 100%;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-nav__icon-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .site-nav__utility {
    gap: 0.15rem;
    margin-left: 0.35rem;
  }

  /* Override header.css's own 992-1199px rules with a tighter budget —
     at this width the row now also has to fit the utility icons + a
     denser CTA, which the template's original sizing didn't account for. */
  .site-header__inner {
    gap: 0.35rem;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav__link,
  .site-nav__submenu-toggle {
    padding: 0.35rem 0.4rem;
    font-size: 0.74rem;
  }

  .site-nav__submenu-toggle i {
    font-size: 0.55rem;
  }

  .site-nav__item--cta .site-nav__link {
    padding: 0.4rem 0.6rem;
    font-size: 0.74rem;
  }

  .site-logo__image {
    width: 32px;
    height: 32px;
  }

  .site-logo__name {
    font-size: 0.8rem;
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .site-nav__utility {
    margin-left: 0.5rem;
  }
}

/* ==========================================================================
   Admin panel — sidebar design (collapsible accordion groups + arrows)
   ========================================================================== */
.admin-sidebar {
  min-height: 100vh;
  width: 268px;
  background: #101828;
  color: #cbd2e1;
  padding-bottom: 1.5rem;
}

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}

.admin-sidebar__brand i {
  color: #6d84f7;
  font-size: 1.1rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 0 0.6rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: #aab2c5;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-nav-link i {
  width: 18px;
  text-align: center;
  color: #6b7690;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.admin-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-nav-link:hover i {
  color: #9aa8ff;
}

.admin-nav-link.is-active {
  background-color: rgba(109, 132, 247, 0.16);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #6d84f7;
}

.admin-nav-link.is-active i {
  color: #8fa0ff;
}

/* Collapsible section groups */
.admin-nav-group {
  margin-top: 0.35rem;
}

.admin-nav-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7c869e;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-nav-group__toggle:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #cbd2e1;
}

.admin-nav-group__label i {
  width: 16px;
  text-align: center;
  margin-right: 0.4rem;
}

.admin-nav-group__arrow {
  font-size: 0.7rem;
  transition: transform 0.25s ease;
}

.admin-nav-group.is-open .admin-nav-group__arrow {
  transform: rotate(180deg);
}

.admin-nav-group__panel {
  max-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 0.15rem;
  transition: max-height 0.3s ease;
}

.admin-nav-group.is-open .admin-nav-group__panel {
  max-height: 640px;
}

/* ==========================================================================
   Admin panel — mobile responsive sidebar
   ========================================================================== */
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.45);
    z-index: 1040;
  }

  .admin-sidebar-backdrop.is-open {
    display: block;
  }

  .admin-sidebar-toggle {
    display: inline-flex !important;
  }

  .admin-topbar h5 {
    font-size: 1rem;
  }

  .admin-topbar form button {
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
  }
}

@media (min-width: 992px) {
  .admin-sidebar-toggle {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .admin-content {
    padding: 1rem 0.75rem;
  }

  .admin-topbar {
    padding: 0.75rem 1rem !important;
  }

  .stat-card {
    margin-bottom: 0.5rem;
  }

  .card.p-4 {
    padding: 1rem !important;
  }
}

/* ==========================================================================
   Patient account area — sidebar + dashboard cards
   ========================================================================== */
.account-sidebar {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.account-sidebar__profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem;
  background: var(--gradient-primary);
  color: #fff;
}

.account-sidebar__avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  overflow: hidden;
}

.account-sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-sidebar__name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}

.account-sidebar__email {
  font-size: 0.78rem;
  opacity: 0.85;
  word-break: break-all;
}

.account-sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 0.6rem;
}

.account-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  color: var(--color-text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.account-sidebar__link i {
  width: 18px;
  text-align: center;
  color: var(--color-text-soft);
}

.account-sidebar__link:hover {
  background: rgba(46, 49, 146, 0.06);
  color: var(--color-primary-dark);
}

.account-sidebar__link.is-active {
  background: rgba(46, 49, 146, 0.09);
  color: var(--color-primary);
  font-weight: 600;
}

.account-sidebar__link.is-active i {
  color: var(--color-primary);
}

.account-sidebar__link--danger:hover {
  background: rgba(232, 32, 34, 0.08);
  color: var(--color-secondary);
}

.account-sidebar__link--danger:hover i {
  color: var(--color-secondary);
}

.account-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
}

.account-stat {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}

.account-stat__value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.account-stat__label {
  font-size: 0.82rem;
  color: var(--color-text-soft);
}

.order-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.order-status-badge--pending { background: rgba(230, 162, 60, 0.15); color: #b6791b; }
.order-status-badge--confirmed { background: rgba(46, 49, 146, 0.12); color: var(--color-primary); }
.order-status-badge--sample_collected { background: rgba(13, 148, 136, 0.12); color: #0d9488; }
.order-status-badge--processing { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.order-status-badge--report_ready { background: rgba(16, 185, 129, 0.14); color: #0ea371; }
.order-status-badge--completed { background: rgba(16, 163, 74, 0.15); color: #15803d; }
.order-status-badge--cancelled { background: rgba(232, 32, 34, 0.12); color: var(--color-secondary); }

@media (max-width: 991.98px) {
  .account-sidebar {
    margin-bottom: 1.5rem;
  }
}
