#rhOrganograma {
  padding: 16px 20px 24px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#rhOrganograma .org-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-bottom: 12px;
}
#rhOrganograma .org-title {
  font-size: 18px;
  font-weight: 700;
  color: #e8ecff;
}
#rhOrganograma .org-sub {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}
#rhOrganograma .org-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#rhOrganograma .org-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}
#rhOrganograma .org-btn.sec {
  background: rgba(255,255,255,.08);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.12);
}
#rhOrganograma .org-niveis { display: none; }
#rhOrganograma .org-canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 16px;
  background: #eceff1;
  border: 1px solid rgba(255,255,255,.08);
  cursor: default;
}
#rhOrganograma .org-canvas-wrap.is-zoom {
  cursor: grab;
}
#rhOrganograma .org-canvas-wrap.is-panning {
  cursor: grabbing;
  user-select: none;
}
#rhOrganograma .org-canvas {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding: 28px 16px 48px;
}
#rhOrganograma .org-fit-slot {
  position: relative;
  margin: 0 auto;
}
#rhOrganograma .org-fit {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  transform-origin: top left;
}
#rhOrganograma:not(.is-edit) .org-anchor,
#rhOrganograma:not(.is-edit) .org-add-child {
  display: none !important;
}
#rhOrganograma:not(.is-edit) .org-pill,
#rhOrganograma:not(.is-edit) .org-leaf {
  cursor: default;
}
#rhOrganograma .org-svg {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}
#rhOrganograma .org-svg path.org-link {
  pointer-events: stroke;
  cursor: pointer;
  fill: none;
  stroke: #90a4ae;
  stroke-width: 2;
}
#rhOrganograma .org-svg path.org-link:hover { stroke: #ef4444; }
#rhOrganograma .org-svg path.org-link-temp {
  fill: none;
  stroke: #0f766e;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  pointer-events: none;
}
#rhOrganograma .org-empty {
  margin: 48px auto;
  text-align: center;
  color: #546e7a;
  font-size: 14px;
  position: relative;
  z-index: 3;
}
#rhOrganograma .org-empty button {
  margin-top: 12px;
}

.org-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.org-kids {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  position: relative;
  padding-top: 28px;
}
.org-kids.org-roots {
  padding-top: 0;
  gap: 48px;
}
.org-kids.org-roots::before,
.org-kids.org-roots::after {
  display: none !important;
}
.org-kids::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 28px;
  background: #cfd8dc;
  transform: translateX(-50%);
}
.org-kids.has-many::after {
  content: "";
  position: absolute;
  top: 0;
  height: 2px;
  background: #cfd8dc;
  left: var(--org-bar-left, 50%);
  right: var(--org-bar-right, 50%);
}
.org-wrap.is-child {
  padding-top: 0;
}
.org-wrap.is-child > .org-card-col::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 50%;
  width: 2px;
  height: 28px;
  background: #cfd8dc;
  transform: translateX(-50%);
}
.org-card-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 248px;
  min-width: 248px;
  max-width: 248px;
  min-height: 64px;
  padding: 8px 16px 8px 12px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
  cursor: grab;
  text-align: left;
  z-index: 3;
}
.org-pill:hover { transform: translateY(-1px); }
.org-pill.org-drop-left { box-shadow: -8px 0 0 #0f766e, 0 8px 18px rgba(15, 23, 42, .12); }
.org-pill.org-drop-right { box-shadow: 8px 0 0 #0f766e, 0 8px 18px rgba(15, 23, 42, .12); }
.org-pill.org-drop-filho { outline: 3px dashed #0f766e; }
.org-avatar {
  position: relative;
  left: 0;
  top: auto;
  transform: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 48px;
  background: #eceff1 center/cover no-repeat;
  box-shadow: 0 0 0 3px var(--org-cor, #0f766e);
}
.org-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.org-avatar .ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  background: var(--org-cor, #0f766e);
}
.org-tag { display: none; }
.org-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.org-name {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
  text-transform: uppercase;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-role {
  font-size: 11px;
  color: #0f766e;
  margin-top: 3px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.org-leaf {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 108px;
  cursor: grab;
  z-index: 3;
}
.org-leaf.org-drop-left { box-shadow: -8px 0 0 #0f766e; }
.org-leaf.org-drop-right { box-shadow: 8px 0 0 #0f766e; }
.org-leaf.org-drop-filho { outline: 3px dashed #0f766e; }
.org-leaf .org-avatar {
  position: relative;
  left: 0;
  top: auto;
  transform: none;
  width: 64px;
  height: 64px;
  box-shadow: 0 0 0 6px var(--org-cor, #ea580c);
}
.org-leaf .org-name,
.org-leaf .org-role {
  text-align: center;
  text-transform: none;
  margin-top: 8px;
  font-size: 11px;
  color: #546e7a;
  font-weight: 600;
  width: 100%;
  white-space: normal;
}
.org-leaf .org-role { margin-top: 2px; font-weight: 500; color: #78909c; }

.org-add-child {
  margin-top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px dashed #90a4ae;
  background: #fff;
  color: #546e7a;
  cursor: pointer;
  font-size: 14px;
}
.org-add-child:hover { background: #e0f2f1; color: #0f766e; }

.org-anchor {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #78909c;
  padding: 0;
  z-index: 5;
  cursor: crosshair;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.org-anchor:hover, .org-anchor.is-on {
  background: #0f766e;
  border-color: #0f766e;
  transform: scale(1.15);
}
.org-anchor[data-pt="top"] { top: -6px; left: 50%; transform: translateX(-50%); }
.org-anchor[data-pt="bottom"] { bottom: -6px; left: 50%; transform: translateX(-50%); }
.org-anchor[data-pt="left"] { left: -6px; top: 50%; transform: translateY(-50%); }
.org-anchor[data-pt="right"] { right: -6px; top: 50%; transform: translateY(-50%); }
.org-leaf .org-anchor[data-pt="bottom"] { bottom: 22px; }
.org-dragging { opacity: .45; }
.org-hint {
  font-size: 12px;
  color: #607d8b;
  margin: 0 0 8px;
  flex-shrink: 0;
}

.org-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.org-modal[hidden] { display: none !important; }
.org-modal-box {
  width: min(460px, 96vw);
  background: #111827;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 16px 18px 18px;
  color: #e2e8f0;
}
.org-modal-box h3 { margin: 0 0 12px; font-size: 16px; }
.org-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; color: #94a3b8; }
.org-field input, .org-field select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14);
  background: #0f172a;
  color: #e8ecff;
  font-size: 13px;
}
.org-user-list {
  max-height: 160px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  margin-top: 6px;
}
.org-user-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}
.org-user-item:hover { background: rgba(255,255,255,.06); }
.org-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}
.org-modal-actions .right { display: flex; gap: 8px; }
.org-btn.danger { background: #b91c1c; }

.org-foco-bar {
  flex-shrink: 0;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(45, 212, 191, .12);
  color: #99f6e4;
  font-size: 13px;
}
.org-print-cabeca {
  display: none;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.org-print-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

#rhOrganograma:not(.is-edit) .org-pill,
#rhOrganograma:not(.is-edit) .org-leaf {
  cursor: pointer;
}

@media print {
  @page { size: landscape; margin: 10mm; }
  body.org-printing .left-side,
  body.org-printing .header,
  body.org-printing #app-boot-overlay,
  body.org-printing .org-actions,
  body.org-printing .org-hint,
  body.org-printing .org-sub,
  body.org-printing .org-foco-bar,
  body.org-printing .org-modal,
  body.org-printing .org-anchor,
  body.org-printing .org-add-child {
    display: none !important;
  }
  body.org-printing,
  body.org-printing #rhOrganograma,
  body.org-printing .org-canvas-wrap {
    background: #ffffff !important;
    color: #111827 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    box-shadow: none !important;
  }
  body.org-printing #rhOrganograma {
    display: block !important;
    padding: 0 !important;
  }
  body.org-printing .org-print-cabeca {
    display: flex !important;
    color: #111827;
  }
  /* Logo da página é clara; no papel branco inverte para ficar visível */
  body.org-printing .org-print-logo {
    filter: invert(1) grayscale(1) contrast(1.15);
  }
  body.org-printing .org-canvas-wrap {
    border: none !important;
    border-radius: 0 !important;
  }
}
