/* Quick Links dropdown popup */
.quick-links-dropdown {
  min-width: 380px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.quick-links-dropdown-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #374151;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.quick-links-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.quick-links-table {
  font-size: 12px;
}

.quick-links-table thead th {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}

.quick-links-table tbody td {
  padding: 8px 10px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.quick-links-table tbody tr:last-child td {
  border-bottom: 0;
}

.quick-links-table tbody tr:hover td {
  background: #f9fafb;
}

/* Topbar layout: company / branch context + mobile-friendly grid */
.navbar-custom.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.navbar-custom.topbar-inner .topbar-nav {
  float: none;
}

.navbar-custom.topbar-inner .topbar-nav-right {
  margin-left: auto;
}

.topbar-context-selects {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem;
}

.header-context-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
  font-size: 0.8125rem;
  text-overflow: ellipsis;
}

@media (max-width: 991.98px) {
  .header-context-select {
    max-width: 180px;
  }
}

@media (max-width: 767.98px) {
  .navbar-custom.topbar-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 60px;
    height: auto;
    padding-bottom: 0.375rem;
    gap: 0;
  }

  .topbar-nav-left {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-nav-right {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
    justify-self: end;
  }

  .topbar-context-selects {
    grid-column: 1 / -1;
    grid-row: 2;
    flex: none;
    width: 100%;
    max-width: 100%;
    padding: 0 0.625rem 0.375rem;
    gap: 0.5rem;
  }

  .header-context-select {
    flex: 1 1 calc(50% - 0.25rem);
    max-width: none;
    width: auto;
  }

  .page-wrapper .page-content-tab {
    margin-top: 100px;
    min-height: calc(100vh - 100px);
  }
}

@media (max-width: 767.98px) {
  body.dark-topbar .header-context-select {
    background-color: #343c50;
    border-color: #4b5563;
    color: #e2e8f0;
  }
}
