/* Gestor STA — Topbar isolada */

.inicio-main {
  min-width: 0;
  margin-left: var(--sta-sidebar-collapsed);
  transition: margin-left 520ms cubic-bezier(.16, 1, .3, 1);
}

.inicio-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 440px) auto;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid #dfe6f2;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px);
}

.inicio-top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inicio-top-left h1 { margin: 0; color: #07173b; font-size: 18px; font-weight: 850; letter-spacing: -.03em; }
.inicio-mobile-menu { display: none; }

.inicio-search {
  height: 36px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dce4f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(7, 23, 59, .04);
}
.inicio-search svg { width: 18px; height: 18px; stroke: #607089; stroke-width: 2; fill: none; }
.inicio-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #07173b; font: inherit; font-size: 13px; font-weight: 600; }
.inicio-search kbd { padding: 3px 7px; border: 1px solid #d9e2ee; border-radius: 6px; background: #f5f7fb; color: #66738a; font-size: 11px; font-weight: 800; }

.inicio-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.inicio-notification-wrap { position: relative; }
.inicio-top-icon {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #e1e8f3;
  border-radius: 999px;
  color: #07173b;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(7,23,59,.05);
}
.inicio-top-icon svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.9; fill: none; }
.inicio-badge {
  position: absolute;
  top: -3px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #0f63ff;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  box-shadow: 0 6px 12px rgba(15,99,255,.3);
}
.inicio-notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  padding: 14px;
  border: 1px solid #e1e8f3;
  border-radius: 14px;
  background: #fff;
  color: #07173b;
  box-shadow: 0 20px 50px rgba(7,23,59,.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}
.inicio-notification-wrap.is-open .inicio-notification-popover { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.inicio-notification-popover strong { display: block; font-size: 14px; margin-bottom: 5px; }
.inicio-notification-popover p { margin: 0; color: #5c6982; font-size: 12px; line-height: 1.45; }

/* Gestor STA v182 — seletor da Conta Master ao lado das notificações */
.master-company-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 30;
}

.master-company-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: linear-gradient(145deg, rgba(8, 28, 64, 0.96), rgba(15, 58, 113, 0.92));
  color: #eaf8ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  box-shadow: 0 14px 30px rgba(8, 18, 42, 0.2), inset 0 1px 0 rgba(255,255,255,0.12);
}

.master-company-button:hover,
.master-company-switcher.is-open .master-company-button {
  border-color: rgba(56, 189, 248, 0.82);
  box-shadow: 0 16px 34px rgba(14, 116, 144, 0.26), 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.master-company-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #f8fbff, #c9e8ff 42%, #0f3b73 100%);
  color: #061735;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  overflow: hidden;
  flex: 0 0 auto;
}

.master-company-avatar.has-image {
  background: #ffffff;
  border: 1px solid rgba(203, 213, 225, 0.75);
}

.master-company-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.master-company-avatar.is-current {
  width: 36px;
  height: 36px;
}

.master-company-badge {
  position: absolute;
  right: -8px;
  bottom: -4px;
  background: #0ea5e9;
  color: #fff;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 2px 5px;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.master-company-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  pointer-events: none;
}

.master-company-switcher.is-open .master-company-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.master-company-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.master-company-head small,
.master-company-current span,
.master-company-foot {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.master-company-head strong,
.master-company-current strong {
  display: block;
  color: #0f172a;
  font-size: 0.98rem;
  margin-top: 2px;
}

.master-company-head button {
  border: 0;
  background: #eef6ff;
  color: #0f3b73;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.master-company-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 10px;
}

.master-company-list {
  display: grid;
  gap: 7px;
  max-height: min(350px, 48vh);
  overflow: auto;
  padding: 4px 2px;
}


.master-company-group {
  display: grid;
  gap: 7px;
}

.master-company-group + .master-company-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.master-company-group-title {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 4px;
}

.master-company-option.is-own-company {
  background: linear-gradient(135deg, rgba(239, 246, 255, 1), rgba(248, 250, 252, 0.98));
  border-color: rgba(37, 99, 235, 0.25);
}

.master-company-option strong {
  color: #1d4ed8;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.master-company-option {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fbff;
  border-radius: 16px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}

.master-company-option:hover,
.master-company-option.is-active {
  background: linear-gradient(135deg, rgba(239, 246, 255, 1), rgba(224, 242, 254, 0.94));
  border-color: rgba(14, 165, 233, 0.45);
}

.master-company-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.master-company-option em {
  font-style: normal;
  color: #0369a1;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.master-company-foot {
  margin: 10px 5px 2px;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .master-company-button {
    width: 40px;
    height: 40px;
  }

  .master-company-badge {
    display: none;
  }

  .master-company-popover {
    right: -8px;
  }
}


/* v183 — seletor master acionado pelo card da empresa na sidebar */
.master-company-switcher-sidebar {
  position: fixed;
  z-index: 120;
  display: block;
  pointer-events: none;
}

.master-company-switcher-sidebar .master-company-popover {
  position: static;
  top: auto;
  right: auto;
}

.master-company-switcher-sidebar.is-open {
  pointer-events: auto;
}

@media (max-width: 720px) {
  .master-company-switcher-sidebar {
    left: 14px !important;
    right: 14px !important;
    bottom: 74px !important;
  }

  .master-company-switcher-sidebar .master-company-popover {
    width: calc(100vw - 28px) !important;
  }
}

/* v3.162.1 — botão de acesso à sidebar visível no mobile.
   topbar.css é carregado depois de sidebar-mobile.css em várias páginas;
   por isso o display mobile precisa existir aqui também para não ser
   sobrescrito pelo display:none desktop. */
@media (max-width: 1023px) {
  .inicio-mobile-menu {
    display: inline-grid !important;
    place-items: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 1px solid #e1e8f3;
    border-radius: 12px;
    background: #fff;
    color: #07173b;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(7, 23, 59, .05);
  }

  .inicio-mobile-menu svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }

  .inicio-top-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
}

