/* ── Brand colours ── */
:root {
  --top-nav-theme-color:      var(--mdb-primary);
  --top-nav-accent:    var(--mdb-gray-200);
  --top-nav-border:    #ebebeb;
  /* --top-nav-text:      var(--mdb-black); 
  --top-nav-muted:     var(--mdb-gray-dark);  */
  --top-nav-text:      #404650; 
  --top-nav-muted:     #848D9C; 
  --nav-h:        78px;
  --header-logo: 110px;
}

.top-bar-wrap {
  border-bottom: 1px solid var(--top-nav-border);
  position: relative;
  z-index: 1050;
}

/* ── Top navbar ── */
.top-navbar {
  background: #fff;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  /* position: sticky; */
  top: 0;
  /* z-index: 1050; */
  gap: 0;
  /* border-bottom: 1px solid var(--top-nav-border); */
}

/* Logo */
.top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 24px;
}

.top-brand img {
    width: var(--header-logo);
}

.top-brand-text { line-height: 1.1; }
.top-brand-text .name {
  font-size: 15px;
  font-weight: 800;
  color: var(--top-nav-theme-color);
  font-style: italic;
  letter-spacing: .02em;
}
.top-brand-text .tagline {
  font-size: 9.5px;
  color: var(--top-nav-muted);
  white-space: nowrap;
}

/* ── Nav links container ── */
.top-nav-links {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-nav-item {
  position: static; /* megamenu is full-width, anchored to navbar */
  display: flex;
  align-items: stretch;
}

.top-nav-link {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--top-nav-text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s, border-color .18s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  outline: none;
}
.top-nav-link:hover,
.top-nav-item.open .top-nav-link {
  color: var(--top-nav-theme-color);
  border-bottom-color: var(--top-nav-theme-color);
}

/* ── Search bar ── */
.top-search {
  flex: 0 0 260px;
  margin: 0 16px;
  min-width: 260px; 
}
.top-search .input-group {
  height: 38px;
}
.top-search input {
  font-size: 13.5px;
  border-radius: 4px;
  padding-left: 36px;
  border: 1px solid var(--top-nav-border);
  background: #fff;
}
.top-search input:focus { 
  box-shadow: 0 0 0 3px rgba(30,90,168,.15); 
  border-color: var(--top-nav-theme-color);
}
.top-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--top-nav-muted);
  font-size: 14px;
  z-index: 6;
  pointer-events: none;
}
.top-search .input-wrapper { position: relative; width: 100%; }

/* ── User badge ── */
.top-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .15s;
  position: relative;
  flex-shrink: 0;
}
.top-user:hover { background: #fff; }
.top-user-info { text-align: right; line-height: 1.25; }
.top-user-name { font-size: 13.5px; font-weight: 600; color: var(--top-nav-theme-color); }
.top-user-acct { font-size: 11.5px; color: var(--mdb-black); font-weight: 500; }
.top-user-company { font-size: 10.5px; color: var(--top-nav-muted); max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--top-nav-theme-color);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  overflow: hidden;
}
.top-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* User dropdown */
.top-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--top-nav-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  min-width: 180px;
  padding: 8px 0;
  z-index: 1060;
  display: none;
}
.top-user-dropdown.open { display: block; }
.top-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--top-nav-text);
  text-decoration: none;
  transition: background .12s;
}
.top-user-dropdown a:hover { background: var(--top-nav-accent); }
.top-user-dropdown a.logout { color: #dc3545; }
.top-user-dropdown a i { width: 18px; text-align: center; }

/* ── Mega-menu panel ── */
.top-mega-panel {
  display: none;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  min-height: 60vh;
  overflow-y: auto;
  background: #fff;
  border-top: 1px solid var(--top-nav-border);
  /* border-bottom: 1px solid var(--top-nav-border);
  box-shadow: 0 12px 40px rgba(0,0,0,.10); */
  z-index: 1040;
  padding: 28px 0 32px;
  animation: megaFadeIn .18s ease;
}
.top-mega-panel.open { display: block; }

@keyframes megaFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Columns grid */
.top-mega-grid {
  display: grid;
  gap: 0;
}
.top-mega-grid.cols-6 { grid-template-columns: repeat(5, 1fr); }
.top-mega-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.top-mega-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.top-mega-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.top-mega-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.top-mega-grid.cols-1 { grid-template-columns: 1fr; }

/* Allow a column to span 2 grid tracks (for wide categories with many items) */
.top-mega-col.span-2 { grid-column: span 2; }

/* Two-column layout WITHIN a single category column */
.top-mega-col-2col {
  columns: 2;
  column-gap: 0;
}
.top-mega-col-2col .top-mega-item {
  break-inside: avoid;
  display: block;
}

.top-mega-col {
  padding: 0 28px;
  border-right: 1px solid var(--top-nav-border);
  margin-bottom: 40px;
}

/* .top-mega-col:first-child { padding-left: 0; } */

/* For middle cols */
@media (min-width: 1240px) {
  /* .top-mega-col:not(:first-child):not(:last-child) { padding-left: 28px; } */
  .top-mega-col:last-child { border-right: none;}
}

.top-mega-section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--top-nav-theme-color);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-left: 4px solid var(--top-nav-theme-color);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0px 10px;
}

/* Menu items */
.top-mega-item {
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--top-nav-text);
  transition: background .14s, transform .14s;
  margin-bottom: 2px;
  display: block;
}
.top-mega-item:hover {
  background: var(--top-nav-accent);
  /* transform: translateX(3px); */
  color: var(--top-nav-theme-color);
}
.top-mega-item .item-title {
  font-size: 15px;
  font-weight: 500;
  color: inherit;
  display: block;
  line-height: 1.3;
}
.top-mega-item .item-desc {
  font-size: 12px;
  color: var(--top-nav-muted);
  display: block;
  margin-top: 1px;
}

/* CTA Buttons at bottom of columns */
.top-mega-cta {
  margin-top: 18px;
}
/* .top-mega-cta .btn {
  font-size: 13px;
  padding: 7px 20px;
  border-radius: 20px;
  border: 1.5px solid var(--top-nav-theme-color);
  color: var(--top-nav-theme-color);
  background: transparent;
  font-weight: 500;
  transition: all .15s;
}
.top-mega-cta .btn:hover {
  background: var(--top-nav-theme-color);
  color: #fff;
} */

/* Feature highlight card (transit time) */
.top-feature-card {
  background: var(--top-nav-accent);
  /* border: 1px solid #c6d9f5; */
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
}
.top-feature-card .fc-title {
  font-size: 14px;
  font-weight: 600;
  /* color: var(--top-nav-theme-color); */
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.top-feature-card .fc-desc {
  font-size: 12px;
  color: var(--top-nav-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.clock-wrap {
  border-radius: 100%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #EAF1F2;
}

/* ════════════════════════════════════════════════════
   MOBILE / RESPONSIVE STYLES (small devices)
   ════════════════════════════════════════════════════ */

/* Hamburger toggle button (hidden on desktop) */
.top-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--top-nav-theme-color);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 8px;
  transition: background .15s;
}
.top-menu-toggle:hover { background: var(--top-nav-accent); }

/* Close button inside the off-canvas sidebar */
.top-sidebar-close {
  display: none;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--top-nav-muted);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

@media (max-width: 640px) {
  .top-search { display: none; }
}

@media (max-width: 1239.98px) {

  /* show hamburger, compact navbar */
  .top-menu-toggle { display: flex; }

  .top-navbar { padding: 0 7px; gap: 10px; justify-content: space-between; }

  .top-brand { margin-right: auto; }
  /* .top-brand img { width: 150px; } */

  /* hide desktop nav links + inline search bar on the bar itself */
  .top-nav-links { display: none; }
  

  /* standalone search icon button shown in mobile header */
  .top-search-toggle {
    /* display: flex; */
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 18px;
    color: var(--top-nav-muted);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 8px;
    transition: background .15s;
  }
  .top-search-toggle:hover { background: var(--top-nav-accent); }

  /* expandable mobile search row (toggled below navbar) */
  .top-mobile-search-row {
    display: none;
    /* display: block; */
    padding: 0 14px 10px 14px;
    border-bottom: 1px solid var(--top-nav-border);
    background: #fff;
    
  }
  .top-mobile-search-row.open { display: block; }
  .top-mobile-search-row .input-wrapper { position: relative; width: 100%; }
  .top-mobile-search-row input {
    width: 100%;
    font-size: 13.5px;
    border-radius: 4px;
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--top-nav-border);
    outline: none;
    background-color: #fff;
  }
  .top-mobile-search-row input:focus { box-shadow: 0 0 0 3px rgba(30,90,168,.15); border-color: var(--top-nav-theme-color); }
  .top-mobile-search-row .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--top-nav-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 6;
  }

  /* shrink user block to just the avatar on small screens */
  .top-user-info { display: none; }
  .top-user { padding: 4px; }
  .top-avatar { width: 38px; height: 38px; }

  /* ── Full-screen mobile navigation overlay ── */
  .top-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1070;
  }
  .top-sidebar-overlay.open { display: block; }

  .top-mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1080;
    display: none;
    flex-direction: row;
    overflow: hidden;
  }
  .top-mobile-nav.open { display: flex; }

  /* close (X) button, top-right of overlay */
  .top-mobile-nav-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: none;
    font-size: 20px;
    color: var(--top-nav-muted);
    cursor: pointer;
    padding: 6px;
    z-index: 15;
    line-height: 1;
  }

  /* left rail: persistent list of top-level menu items */
  .top-mobile-rail {
    width: 145px;
    flex-shrink: 0;
    background: var(--top-nav-accent);
    overflow-y: auto;
    padding-top: 38px;
  }
  .top-mobile-rail-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 13px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--top-nav-text);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow-x: hidden;
  }
  .top-mobile-rail-item.active {
    background: #fff;
    color: var(--top-nav-theme-color);
  }
  .top-mobile-rail-item.active:after {
    position: absolute;
    content: '';
    top: 0;
    right: -2px;
    width: 3px;
    height: 100%;
    background: #fff;
  }

  /* right panel: content for the active menu */
  .top-mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
  }

  /* ════════ mega panels rendered inline inside the mobile content panel ════════ */
  .top-mega-panel {
    display: none;
  }
  .top-mega-panel.mobile-active {
    display: block;
    position: relative;
    top: 0;
    height: auto;
    overflow-y: visible;
    box-shadow: none;
    border-color: transparent;
    padding: 50px 14px 14px;
  }

  .top-mega-panel-body { padding: 0; }

  /* grid -> stacked sections, full width */
  .top-mega-grid.cols-5,
  .top-mega-grid.cols-4,
  .top-mega-grid.cols-3,
  .top-mega-grid.cols-2,
  .top-mega-grid.cols-1 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* reset span and two-column on mobile */
  .top-mega-col.span-2 { grid-column: span 1; }
  .top-mega-col-2col { columns: 1; }

  .top-mega-col {
    padding: 0;
    border-right: none;
  }

  .top-mega-col:not(:last-child) {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--top-nav-border);
  }

  /* section titles: static labels (always visible, not collapsible) */
  .top-mega-section-title {
    margin: 0 0 10px 7px;
    padding: 0 0 0 10px;
  }

  .top-mega-col-body {
    display: block;
  }

  .top-mega-item {
    padding: 8px 0 8px 10px;
  }
  .top-mega-item:hover {
    transform: none;
  }

  .top-mega-cta { margin-top: 12px; padding: 0 10px; }
  .top-mega-cta .btn,
  .top-feature-card .btn {
    width: 100%;
  }
  .top-feature-card { margin-left: 10px; margin-right: 10px; }

  /* hide desktop overlay on mobile (sidebar overlay handles it) */
  #dlOverlay { display: none }
}
@media (max-width: 640px) {
.top-mobile-search-row {
    /* display: none; */
    display: block;
    padding: 8px 14px 8px 14px;
    border-bottom: 1px solid var(--top-nav-border);
    background: #fff;
  }
}

@media (min-width: 1240px) {
  .top-sidebar-overlay,
  .top-mobile-nav,
  .top-menu-toggle,
  .top-search-toggle,
  .top-mobile-search-row {
    display: none;
  }
}