:root{
  /* 30% navy bar — solid (no split / gradient band) */
  --walajna-bar: #1a2f4a;
  --walajna-bar-dark: #1a2f4a;
  --walajna-bar-deep: #152638;
  --walajna-text: #f0f5fb;
  --walajna-hover: rgba(255,255,255,.14);
  --walajna-hover-strong: rgba(255,255,255,.24);
  --walajna-radius: 0px;
  --walajna-shadow: 0 10px 28px rgba(8, 30, 52, .18);
  --walajna-border: rgba(255,255,255,.2);
}

*{
  box-sizing: border-box;
}

/* Reserve vertical space: .walajna-topbar is position:fixed and does not contribute to flow height */
#navbar-container{
  min-height: var(--walajna-topbar-height, 88px);
}

.walajna-topbar{
  min-height: 88px;
  height: 88px;
  background: var(--walajna-bar);
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  box-shadow: var(--walajna-shadow);
  border-bottom: 1px solid var(--walajna-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.walajna-topbar::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.12), rgba(255,255,255,0) 48%);
}

.walajna-topbar__inner{
  width: 100%;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  position: relative;
  z-index: 1;
}

@media (min-width: 769px) {
  .walajna-topbar__inner {
    flex-wrap: nowrap;
  }
}

/* Hamburger — hidden on desktop */
.walajna-nav-toggle{
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  color: var(--walajna-text);
  cursor: pointer;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.walajna-nav-toggle__bars,
.walajna-nav-toggle__bars::before,
.walajna-nav-toggle__bars::after{
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
}

.walajna-nav-toggle__bars::before,
.walajna-nav-toggle__bars::after{
  content: "";
  position: absolute;
  left: 0;
}

.walajna-nav-toggle__bars::before{ top: -6px; }
.walajna-nav-toggle__bars::after{ top: 6px; }

#navbar-container.is-nav-open .walajna-nav-toggle__bars,
.walajna-topbar.is-nav-open .walajna-nav-toggle__bars{
  background: transparent;
}
#navbar-container.is-nav-open .walajna-nav-toggle__bars::before,
.walajna-topbar.is-nav-open .walajna-nav-toggle__bars::before{
  top: 0;
  transform: rotate(45deg);
}
#navbar-container.is-nav-open .walajna-nav-toggle__bars::after,
.walajna-topbar.is-nav-open .walajna-nav-toggle__bars::after{
  top: 0;
  transform: rotate(-45deg);
}

.walajna-nav-panel{
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
}

.walajna-topbar__brand-group{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.walajna-nav-backdrop{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 109;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

body.walajna-nav-open{
  overflow: hidden;
}

/* Keeps a wide wordmark from squeezing nav links; logo height capped to bar (see .brand-logo). */
.walajna-topbar__brand{
  flex-shrink: 0;
  max-width: min(78vw, 680px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* روابط التنقل */
.walajna-topbar__nav{
  display: flex;
  align-items: center;
  gap: 30px;
  justify-content: flex-start;
}

.walajna-topbar__nav a{
  text-decoration: none;
  color: var(--walajna-text);
  font-weight: 900;
  font-size: 20px;
  padding: 12px 14px;
  border-radius: 14px;
  transition:
    background .18s ease,
    transform .18s ease,
    box-shadow .18s ease,
    color .18s ease;
  position: relative;
}

.nav-unread-dot{
  position:absolute;
  top:6px;
  inset-inline-end:6px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#ff3b30;
  border:2px solid rgba(255,255,255,0.95);
  box-shadow:0 0 10px rgba(255,59,48,0.75);
}

.walajna-topbar__nav a:hover{
  background: var(--walajna-hover);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  transform: translateY(-1px);
}

/* تمييز الصفحة الحالية */
.walajna-topbar__nav a.is-active{
  background: rgba(255,255,255,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 8px 18px rgba(11,15,20,.08);
}

/* الأيقونات (يسار) */
.walajna-topbar__icons{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.20);
  color: var(--walajna-text);
  text-decoration: none;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 6px 14px rgba(11,15,20,.08);
  transition:
    transform .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.icon-btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 10px 18px rgba(11,15,20,.12);
}

.brand-logo-link{
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-logo-link:focus-visible{
  outline: 2px solid rgba(94, 231, 247, 0.75);
  outline-offset: 6px;
  border-radius: 10px;
}

.brand-logo{
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  /* Full height of the topbar minus padding. */
  max-height: calc(var(--walajna-topbar-height, 88px) - 6px);
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.25));
}

/* Role switcher */
.nav-role-switcher{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 10px;
}

.nav-role-switcher__label{
  font-size: 13px;
  font-weight: 800;
  color: inherit;
}

.nav-role-switcher__select{
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 4px 10px rgba(11,15,20,.06);
  transition:
    background .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

/* theme.css forces all <select> to page ink; bar stays dark — need ID scope to win specificity */
#navbar-container .nav-role-switcher__select{
  color: #fff;
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
}

.nav-role-switcher__select:hover{
  background: rgba(255,255,255,0.24);
}

.nav-role-switcher__select:focus{
  outline: none;
  border-color: rgba(255,255,255,.36);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.2),
    0 0 0 4px rgba(255,255,255,.12);
}

.nav-role-switcher__select option{
  color: #1a2f4a;
  background: white;
}

/* ===== Dark mode only ===== */
body.dark-mode{
  --walajna-bar: #020617;
  --walajna-bar-dark: #020617;
  --walajna-bar-deep: #020b1a;
  --walajna-text: #e5edf7;
  --walajna-hover: rgba(148,163,184,.12);
  --walajna-hover-strong: rgba(148,163,184,.24);
  --walajna-shadow: 0 18px 42px rgba(15,23,42,.85);
  --walajna-border: rgba(148,163,184,.35);
}

body.dark-mode .walajna-topbar::after{
  background: linear-gradient(to bottom, rgba(15,23,42,.38), rgba(15,23,42,0) 52%);
}

body.dark-mode .walajna-topbar__nav a:hover{
  box-shadow: 0 10px 28px rgba(15,23,42,.75);
}

body.dark-mode .walajna-topbar__nav a.is-active{
  background: rgba(34,211,238,.18);
  box-shadow: 0 16px 46px rgba(8,145,178,.55);
}

body.dark-mode .icon-btn{
  border: 1px solid var(--walajna-border);
  background: rgba(15,23,42,.92);
  box-shadow: 0 10px 26px rgba(15,23,42,.9);
}

body.dark-mode .icon-btn:hover{
  background: rgba(15,23,42,1);
  box-shadow: 0 16px 40px rgba(15,23,42,1);
}

body.dark-mode .brand-logo-link{
  background: transparent;
  box-shadow: none;
}

body.dark-mode .brand-logo{
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.45));
}

body.dark-mode #navbar-container .nav-role-switcher__select{
  border: 1px solid var(--walajna-border);
  background: rgba(15,23,42,.9);
  box-shadow: 0 10px 26px rgba(15,23,42,.9);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
}

body.dark-mode .nav-role-switcher__select:hover{
  background: rgba(15,23,42,1);
}

body.dark-mode .nav-role-switcher__select:focus{
  border-color: #06b6d4;
  box-shadow: 0 0 0 1px rgba(34,211,238,.5);
}

body.dark-mode .nav-role-switcher__select option{
  color: #e5edf7;
  background: #020617;
}

/* Phone: side drawer menu (panel is sibling of header — not clipped by topbar) */
@media (max-width: 768px){
  .walajna-topbar{
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .walajna-topbar__inner{
    height: 100%;
    min-height: 0;
    padding: 0 12px;
    gap: 0;
    flex-wrap: nowrap;
    align-items: center;
  }

  .walajna-topbar__brand-group{
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .walajna-nav-toggle{
    display: inline-flex;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }

  .walajna-topbar__brand{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    flex: unset;
    max-width: min(calc(100% - 108px), 280px);
    justify-content: center;
    pointer-events: none;
  }

  .walajna-topbar__brand .brand-logo-link{
    pointer-events: auto;
  }

  .walajna-topbar__icons{
    display: none !important;
  }

  .walajna-nav-drawer-extras{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    width: 100%;
  }

  #navbar-container .walajna-nav-panel{
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(88vw, 300px);
    max-width: 300px;
    z-index: 110;
    overflow-y: auto;
    padding: calc(var(--walajna-topbar-height, 64px) + 16px) 16px max(24px, env(safe-area-inset-bottom, 16px));
    background: var(--walajna-bar);
    border-inline-end: 1px solid var(--walajna-border);
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.35);
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.28s ease, visibility 0.28s;
  }

  [dir="rtl"] #navbar-container .walajna-nav-panel{
    transform: translate3d(100%, 0, 0);
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.35);
  }

  #navbar-container.is-nav-open .walajna-nav-panel{
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }

  #navbar-container.is-nav-open .walajna-nav-backdrop{
    display: block;
  }

  .walajna-topbar__nav{
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }

  .walajna-topbar__nav a{
    font-size: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    width: 100%;
  }

  .nav-role-switcher{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 12px 0 0;
  }

  .nav-role-switcher__select{
    width: 100%;
  }

  .brand-logo{
    max-height: 44px;
  }

  .icon-btn{
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

@media (min-width: 769px){
  /* Laptop/desktop: nav (inline-start) | logo center | icons (inline-end) — mirrors with dir=rtl/ltr */
  .walajna-topbar{
    height: 88px;
    min-height: 88px;
    padding: 0;
  }

  .walajna-topbar__inner{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    padding: 0 26px;
    gap: 16px 22px;
  }

  .walajna-topbar__leading,
  .walajna-topbar__cluster{
    display: contents;
  }

  .walajna-topbar__inner > .walajna-nav-panel{
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    min-width: 0;
    max-width: 100%;
  }

  .walajna-topbar__brand-group{
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
  }

  .walajna-topbar__brand-group .brand-logo-link{
    pointer-events: auto;
  }

  .walajna-topbar__icons{
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  [dir="rtl"] .walajna-topbar__icons{
    flex-direction: row-reverse;
  }

  #navbar-container > .walajna-nav-panel{
    display: none !important;
  }

  .walajna-nav-toggle{
    display: none !important;
  }

  #navbar-container .walajna-nav-panel,
  .walajna-nav-panel{
    display: flex !important;
    position: static;
    flex: 1 1 auto;
    overflow: visible;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    width: auto;
    max-width: none;
    inset: auto;
  }

  .walajna-topbar__nav{
    flex-direction: row;
    flex-wrap: nowrap;
    width: auto;
    max-width: 100%;
    gap: clamp(12px, 2vw, 30px);
  }

  .walajna-topbar__nav a{
    white-space: nowrap;
  }

  .walajna-topbar__nav a{
    width: auto;
    font-size: 20px;
    padding: 12px 14px;
  }

  .walajna-topbar__brand{
    max-width: min(78vw, 680px);
  }

  .brand-logo{
    max-height: calc(var(--walajna-topbar-height, 88px) - 6px);
  }

  .walajna-nav-backdrop{
    display: none !important;
  }

  body.walajna-nav-open{
    overflow: auto;
  }
}

/* Pages (e.g. messages.css) use `* { font-family: ... }` after this file; keep bar chrome consistent */
.walajna-topbar,
.walajna-topbar *{
  font-family: var(--wl-font-family, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif);
}