/* ==========================================================================
   Rahavard Danesh — Navigation (header, navbar, drawer, sidebar, breadcrumbs)
   ========================================================================== */

/* ------------------------------------------------------------------------
   Header / top navbar (public site)
   ------------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--fw-bold);
  font-size: 1.15rem;
  color: var(--color-text);
}

.brand__mark {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}

.brand__name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand__name small {
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  color: var(--color-text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.main-nav__link {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-soft);
  transition: color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}

.main-nav__link:hover {
  color: var(--color-primary-dark);
  background: var(--color-primary-tint);
}

.main-nav__link.is-active {
  color: var(--color-primary-dark);
  font-weight: var(--fw-semibold);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  place-items: center;
  color: var(--color-text);
}
.hamburger:hover { background: var(--color-surface-3); }
.hamburger__lines {
  position: relative;
  width: 22px;
  height: 14px;
}
.hamburger__lines span {
  position: absolute;
  inset-inline-start: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease),
              opacity var(--dur-base) var(--ease);
}
.hamburger__lines span:nth-child(1) { top: 0; }
.hamburger__lines span:nth-child(2) { top: 6px; }
.hamburger__lines span:nth-child(3) { top: 12px; }

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ------------------------------------------------------------------------
   Mobile drawer
   ------------------------------------------------------------------------ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, 0.5);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease),
              visibility var(--dur-base) var(--ease);
}

.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: min(320px, 85vw);
  background: var(--color-surface);
  z-index: var(--z-drawer);
  padding: var(--space-5);
  transform: translateX(-100%);
  transition: transform var(--dur-base) var(--ease);
  display: flex;
  flex-direction: column;
}

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

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.drawer__link {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-weight: var(--fw-medium);
  color: var(--color-text-soft);
}
.drawer__link:hover {
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
}

.drawer__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ------------------------------------------------------------------------
   Dashboard sidebar
   ------------------------------------------------------------------------ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar toggle/close buttons (hidden on desktop, shown on mobile) */
.sidebar-toggle,
.sidebar-close {
  display: none;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface);
  border-inline-end: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width var(--dur-base) var(--ease);
}

.sidebar__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--header-height);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__group-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: var(--space-4) var(--space-3) var(--space-2);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-soft);
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.sidebar__link svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: color var(--dur-fast) var(--ease);
}

.sidebar__link:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.sidebar__link.is-active {
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
  font-weight: var(--fw-semibold);
}
.sidebar__link.is-active svg { color: var(--color-primary-dark); }

.sidebar__footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* Main content area */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  min-height: var(--header-height);
}

.topbar__title {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.notification-btn {
  position: relative;
}
.notification-btn__dot {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface);
}

.app-content {
  flex: 1;
  padding: var(--space-6);
  background: var(--color-surface-2);
}

/* ------------------------------------------------------------------------
   Breadcrumbs
   ------------------------------------------------------------------------ */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--fs-body-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.breadcrumbs a { color: var(--color-text-soft); }
.breadcrumbs a:hover { color: var(--color-primary-dark); }

.breadcrumbs__sep { color: var(--color-border-strong); }

/* ------------------------------------------------------------------------
   Dropdown menu
   ------------------------------------------------------------------------ */
.dropdown {
  position: relative;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease),
              visibility var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  z-index: var(--z-header);
}

.dropdown.is-open .dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  color: var(--color-text-soft);
  text-align: start;
}
.dropdown__item:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
