/* Unified Mahara navigation across public, workspace and administration screens. */
:root {
  --mahara-nav-ink: #111712;
  --mahara-nav-green: #08704a;
  --mahara-nav-green-dark: #063e2b;
  --mahara-nav-lime: #d9ff66;
  --mahara-nav-muted: #647068;
  --mahara-nav-line: #e1e7e3;
  --mahara-nav-soft: #f1f7f3;
  --mahara-nav-shadow: 0 12px 34px rgba(13, 42, 27, .07);
}

/* One brand mark in every navigation surface. */
.brand-symbol,
body.admin-shell .admin-brand .brand-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--mahara-nav-lime);
  background: var(--mahara-nav-green-dark);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  box-shadow: none;
}
.brand-symbol svg { width: 31px; height: 31px; }

/* Public header. */
body.site-shell .main-header,
body.workspace-page .main-header,
body.auth-shell .main-header,
body.exchange-home .main-header {
  min-height: 72px;
  padding: 0;
  background: rgba(255, 255, 255, .98);
  border-color: var(--mahara-nav-line);
  box-shadow: none;
  transform: none !important;
}
body.site-shell .main-header.is-scrolled,
body.site-shell .main-header.header-scrolled {
  min-height: 66px;
  padding: 0;
  background: rgba(255, 255, 255, .985);
  border-color: #d9e1dc;
  box-shadow: 0 8px 28px rgba(13, 42, 27, .055);
}
body.site-shell .header-container {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(18px, 2vw, 30px);
  width: min(calc(100% - 40px), 1400px);
  min-height: 71px;
}
body.site-shell .brand-link { gap: 10px; }
body.site-shell .brand-copy strong { color: var(--mahara-nav-ink); font-size: 1rem; }
body.site-shell .brand-copy small { margin-top: 4px; color: var(--mahara-nav-muted); font-size: .63rem; }

body.site-shell .nav-menu { gap: 3px; }
body.site-shell .nav-link,
body .nav-menu a.nav-hiring-link,
body.exchange-home .nav-menu a.nav-hiring-link {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: #39443d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .79rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}
body.site-shell .nav-link:hover,
body.site-shell .nav-link.active,
body .nav-menu a.nav-hiring-link:hover,
body .nav-menu a.nav-hiring-link.active {
  color: var(--mahara-nav-green-dark);
  background: var(--mahara-nav-soft);
  border-color: #dce9e1;
}
body.site-shell .nav-link.active::after { display: none; }

.nav-more-wrapper { position: relative; }
body.site-shell .nav-more-btn {
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.nav-more-btn i { color: #879189; font-size: .55rem; transition: transform .2s ease; }
.nav-more-wrapper.active .nav-more-btn i { transform: rotate(180deg); }
body.site-shell .nav-more-menu {
  top: calc(100% + 10px);
  right: auto;
  left: 0;
  display: grid;
  width: 224px;
  padding: 7px;
  overflow: visible;
  border-radius: 13px;
  box-shadow: var(--mahara-nav-shadow);
}
.nav-more-wrapper.active .nav-more-menu { visibility: visible; opacity: 1; transform: none; }
body.site-shell .nav-more-menu a {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 9px;
  color: #354039;
  border-radius: 8px;
  font-size: .77rem;
  font-weight: 700;
  text-decoration: none;
}
body.site-shell .nav-more-menu a:hover,
body.site-shell .nav-more-menu a.is-active { color: var(--mahara-nav-green-dark); background: var(--mahara-nav-soft); }
body.site-shell .nav-more-menu i { color: var(--mahara-nav-green); text-align: center; }

body.site-shell .header-actions { gap: 7px; }
.brand-en-corner {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  padding: 0 9px;
  color: var(--mahara-nav-green-dark);
  background: var(--mahara-nav-soft);
  border: 1px solid #dce9e1;
  border-radius: 99px;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .07em;
  white-space: nowrap;
}
.footer-parent-brand { color: inherit; font-weight: 700; }
body.site-shell .header-cta,
body.site-shell .user-btn,
body.site-shell .header-icon-btn,
body.site-shell .notif-btn {
  min-height: 41px;
  border-radius: 10px;
}
body.site-shell .header-cta { padding-inline: 14px; }
body.site-shell .user-btn { background: #fff; border-color: var(--mahara-nav-line); }
body.site-shell .header-icon-btn,
body.site-shell .notif-btn { width: 41px; height: 41px; background: #fff; border-color: var(--mahara-nav-line); }
body.site-shell .header-icon-btn:hover { border-color: #aab8af; transform: none; }

body.site-shell .user-dropdown {
  width: 286px;
  max-height: min(72vh, 640px);
  padding: 7px;
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: var(--mahara-nav-shadow);
}
body.site-shell .dropdown-kicker {
  padding: 9px 10px 5px;
  color: var(--mahara-nav-muted);
  font-size: .61rem;
  font-weight: 850;
}
body.site-shell .dropdown-item {
  min-height: 38px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: .76rem;
}
body.site-shell .dropdown-item:hover { color: var(--mahara-nav-green-dark); background: var(--mahara-nav-soft); }
body.site-shell .dropdown-item:hover i { color: var(--mahara-nav-green); }
body.site-shell .dropdown-divider { margin: 5px 7px; background: var(--mahara-nav-line); }

/* Workspace navigation uses the same spacing, active state and color language. */
.workspace-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 5px;
  margin-bottom: 26px;
  padding: 8px;
  overflow: visible;
  background: #fff;
  border: 1px solid var(--mahara-nav-line);
  border-radius: 13px;
  box-shadow: 0 7px 22px rgba(13, 42, 27, .035);
}
.workspace-nav-context {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  margin-left: 2px;
  padding: 7px 11px;
  color: var(--mahara-nav-green-dark);
  background: var(--mahara-nav-soft);
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 850;
  white-space: nowrap;
  justify-content: center;
}
.workspace-nav a {
  justify-content: center;
  min-height: 38px;
  gap: 7px;
  padding: 7px 10px;
  color: #566159;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .76rem;
  font-weight: 750;
}
.workspace-nav a:hover { color: var(--mahara-nav-green-dark); background: var(--mahara-nav-soft); border-color: #e0ebe4; }
.workspace-nav a.is-active {
  color: #fff;
  background: var(--mahara-nav-green-dark);
  border-color: var(--mahara-nav-green-dark);
  box-shadow: 0 5px 13px rgba(6, 62, 43, .13);
}
.workspace-nav a.is-active i { color: var(--mahara-nav-lime); }

/* Administration keeps its focused dark rail with the same mark and controls. */
body.admin-shell .sidebar { background: #0f1712; border-color: #27332b; }
.admin-sidebar-close { display: none; }
body.admin-shell .admin-brand { margin: 17px 16px 13px; padding: 8px 6px 17px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
body.admin-shell .admin-brand .brand-symbol { color: var(--mahara-nav-lime); background: var(--mahara-nav-green); }
body.admin-shell .admin-sidebar { gap: 16px; padding-top: 10px; }
body.admin-shell .sidebar-section { gap: 4px; }
body.admin-shell .sidebar-section-title { margin: 10px 10px 5px; color: #849188; }
body.admin-shell .sidebar-link {
  min-height: 39px;
  padding: 8px 10px;
  color: #b7c2ba;
  border-radius: 8px;
  font-size: .76rem;
}
body.admin-shell .sidebar-link:hover { color: #fff; background: #19251d; }
body.admin-shell .sidebar-link.active {
  color: #0c2519;
  background: var(--mahara-nav-lime);
  box-shadow: none;
}
body.admin-shell .sidebar-link.active i { color: #0c5137; }
body.admin-shell .topbar {
  min-height: 64px;
  padding: 0;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--mahara-nav-line);
  box-shadow: 0 7px 22px rgba(13, 42, 27, .035);
}
body.admin-shell .topbar-container { min-height: 63px; padding: 0; }
body.admin-shell .topbar-search-form,
body.admin-shell .topbar-date,
body.admin-shell .topbar-logout { border-radius: 8px; }

@media (max-width: 1100px) and (min-width: 761px) {
  .workspace-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Mobile navigation. */
@media (max-width: 1240px) {
  body.site-shell .header-container { grid-template-columns: auto 1fr; }
  body.site-shell .nav-menu { display: none; }
  body.site-shell .header-actions { justify-self: end; }
  body.site-shell .mobile-menu-btn { display: grid; }
  body.site-shell .brand-en-corner { display: none; }
}

@media (max-width: 760px) {
  body.site-shell .main-header,
  body.workspace-page .main-header,
  body.auth-shell .main-header,
  body.exchange-home .main-header { min-height: 62px; }
  body.site-shell .header-container { width: min(calc(100% - 24px), 1400px); min-height: 61px; gap: 12px; }
  body.site-shell .brand-symbol { width: 37px; height: 37px; flex-basis: 37px; border-radius: 9px; }
  body.site-shell .brand-symbol svg { width: 27px; height: 27px; }
  body.site-shell .brand-copy small { display: none; }
  body.site-shell .user-info,
  body.site-shell .header-cta,
  body.site-shell .header-login { display: none; }
  body.site-shell .user-btn { width: 41px; padding: 3px; }
  body.site-shell .user-chevron { display: none; }

  body.site-shell .mobile-menu {
    width: min(92vw, 390px);
    padding: 16px;
    overflow: hidden;
    background: #fff;
  }
  body.site-shell .mobile-menu-header { min-height: 54px; padding-bottom: 13px; }
  body.site-shell .mobile-menu-header .brand-copy small { display: block; }
  body.site-shell .mobile-nav-links {
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 14px 2px;
    overflow-y: auto;
  }
  body.site-shell .mobile-nav-links a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    min-height: 57px;
    align-items: center;
    padding: 8px 10px;
    color: var(--mahara-nav-ink);
    background: #fff;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: .83rem;
  }
  body.site-shell .mobile-nav-links a > i {
    grid-row: 1 / span 2;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--mahara-nav-green);
    background: var(--mahara-nav-soft);
    border-radius: 8px;
    font-size: .75rem;
  }
  body.site-shell .mobile-nav-links a > span { align-self: end; font-weight: 850; }
  body.site-shell .mobile-nav-links a > b { align-self: start; color: var(--mahara-nav-muted); font-size: .62rem; font-weight: 500; }
  body.site-shell .mobile-nav-links a:hover,
  body.site-shell .mobile-nav-links a.is-active { color: var(--mahara-nav-green-dark); background: var(--mahara-nav-soft); border-color: #dce9e1; }
  body.site-shell .mobile-nav-links a.is-active > i { color: var(--mahara-nav-lime); background: var(--mahara-nav-green-dark); }
  body.site-shell .mobile-menu-actions { padding-top: 12px; border-top: 1px solid var(--mahara-nav-line); }

  .app-shell { width: min(calc(100% - 24px), 1240px); padding-top: 15px; }
  .workspace-nav {
    position: sticky;
    top: 62px;
    z-index: 35;
    display: flex;
    flex-wrap: nowrap;
    margin-inline: -12px;
    margin-bottom: 18px;
    padding: 7px 12px;
    overflow-x: auto;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: 0 7px 18px rgba(13, 42, 27, .04);
    scrollbar-width: none;
  }
  .workspace-nav::-webkit-scrollbar { display: none; }
  .workspace-nav-context { min-height: 36px; padding-inline: 9px; font-size: 0; }
  .workspace-nav-context i { font-size: .72rem; }
  .workspace-nav a { min-height: 36px; padding: 6px 9px; font-size: .71rem; }

  body.admin-shell .topbar-container { min-height: 58px; }
  body.admin-shell .topbar > .container { display: flex; align-items: center; gap: 8px; }
  body.admin-shell .topbar > .container > .topbar-container { flex: 1; min-width: 0; }
  body.admin-shell .topbar-actions { width: 100%; min-width: 0; }
  body.admin-shell .topbar-context,
  body.admin-shell .topbar-date { display: none; }
  body.admin-shell .topbar-search-form { width: auto; min-width: 0; flex: 1; }
  body.admin-shell .topbar-logout { flex: 0 0 auto; }
  body.admin-shell .sidebar-toggle { min-height: 40px; border-radius: 9px; }
  body.admin-shell .sidebar-toggle {
    position: static;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    justify-content: center;
    align-items: center;
    padding: 0;
    color: #0c2519;
    background: var(--mahara-nav-lime);
    box-shadow: none;
  }
  body.admin-shell .sidebar-toggle span { display: none; }
  body.admin-shell .admin-sidebar-close {
    position: absolute;
    top: 18px;
    left: 16px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #dce6df;
    background: #17251c;
    border: 1px solid #304038;
    border-radius: 9px;
    cursor: pointer;
  }
}

@media (max-width: 430px) {
  body.site-shell .brand-copy strong { font-size: .9rem; }
  body.site-shell .header-actions { gap: 5px; }
  body.site-shell .notif-btn,
  body.site-shell .header-icon-btn,
  body.site-shell .user-btn { width: 38px; height: 38px; min-height: 38px; }
}
