/* Job roles, organization chart and directory. Colours come from the portal theme variables (per-organization branding). */
#orgRoles .or-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
#orgRoles .or-head p { max-width: 720px; }
#orgRoles .or-kpis { margin-bottom: 16px; }
#orgRoles .or-roles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
#orgRoles .or-role { display: grid; gap: 10px; align-content: start; }
#orgRoles .or-role-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
#orgRoles .or-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#orgRoles .or-desc { font-size: 13.5px; line-height: 1.5; }
.or-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
#orgRoles .or-links { display: flex; flex-wrap: wrap; gap: 6px; }
#orgRoles .or-link { font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; background: var(--paper); }
#orgRoles .or-link b { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); margin-right: 6px; }
#orgRoles .or-holders { margin-top: 2px; }
#orgRoles .or-empty { padding: 6px 0; }
#orgRoles .or-note { background: var(--gold-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
#orgRoles .or-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
#orgRoles .or-filter input[type=search] { flex: 1 1 260px; max-width: 420px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 13px; background: #fff; }
#orgRoles .or-people { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
#orgRoles .or-person { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; cursor: pointer; font: inherit; color: inherit; min-width: 0; }
#orgRoles .or-person:hover, #orgRoles .or-person:focus-visible { border-color: var(--gold); }
.or-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.or-avatar.big { flex-basis: 56px; width: 56px; height: 56px; font-size: 18px; }
.or-card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
#orgRoles .or-who { display: grid; gap: 2px; min-width: 0; font-size: 13px; }
#orgRoles .or-who strong, #orgRoles .or-who span, #orgRoles .or-who small { overflow-wrap: anywhere; }
#orgRoles .or-who small { color: var(--muted); font-size: 11.5px; }

/* Chart: a compact top-to-bottom tree. Each level is indented under its parent with connector lines; people with
   nobody under them sit in a small grid. Fits the page width on desktop and phone (no sideways scrolling). */
#orgRoles .or-chart { padding: 16px; overflow-x: auto; }
#orgRoles .or-tree, #orgRoles .or-tree ul { list-style: none; margin: 0; padding: 0; }
#orgRoles .or-tree > li + li { margin-top: 10px; }
#orgRoles .or-tree ul { margin-left: 14px; }
#orgRoles .or-tree ul > li { position: relative; padding: 8px 0 0 20px; }
#orgRoles .or-tree ul > li::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line); }
#orgRoles .or-tree ul > li:last-child::before { bottom: auto; height: 27px; }
#orgRoles .or-tree ul > li::after { content: ''; position: absolute; left: 0; top: 27px; width: 16px; border-top: 2px solid var(--line); }
/* A group of people with nobody under them: a compact grid under one connector. */
#orgRoles .or-tree ul:not(:has(> li > ul)):has(> li:nth-child(3)) { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin-left: 14px; padding: 8px 0 0 20px; border-left: 2px solid var(--line); }
#orgRoles .or-tree ul:not(:has(> li > ul)):has(> li:nth-child(3)) > li { padding: 0; }
#orgRoles .or-tree ul:not(:has(> li > ul)):has(> li:nth-child(3)) > li::before, #orgRoles .or-tree ul:not(:has(> li > ul)):has(> li:nth-child(3)) > li::after { display: none; }
#orgRoles .or-tree ul:not(:has(> li > ul)):has(> li:nth-child(3)) .or-node { width: 100%; }
#orgRoles .or-node { position: relative; width: min(100%, 320px); background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 8px; }
#orgRoles .or-node.me { border-left-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
#orgRoles .or-node.group { background: var(--navy); border-color: var(--navy); color: #fff; }
#orgRoles .or-node.group small, #orgRoles .or-node.group span { color: #ffffffc0; }
#orgRoles .or-node.vacant { border: 1px dashed var(--warning); border-left-width: 4px; background: #fffaf0; }
#orgRoles .or-node-main { display: grid; gap: 1px; width: 100%; padding: 7px 44px 7px 10px; text-align: left; background: none; border: 0; font: inherit; color: inherit; }
#orgRoles button.or-node-main { cursor: pointer; }
#orgRoles button.or-node-main:hover strong { text-decoration: underline; }
#orgRoles .or-node-main strong { font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
#orgRoles .or-node-main span { font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
#orgRoles .or-node-main small { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
#orgRoles .or-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 1; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 11px; font-weight: 700; cursor: pointer; }
#orgRoles .or-loose { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 8px 0 0; padding: 0; }

@media (max-width: 720px) {
  #orgRoles .or-head { flex-direction: column; }
  #orgRoles .or-roles { grid-template-columns: 1fr; }
  /* Phones: tighter indentation; the same top-to-bottom tree. */
  #orgRoles .or-chart { padding: 12px 8px; }
  #orgRoles .or-tree ul { margin-left: 8px; }
  #orgRoles .or-tree ul > li { padding-left: 14px; }
  #orgRoles .or-tree ul > li::after { width: 10px; }
  #orgRoles .or-node { width: 100%; }
  #orgRoles .or-tree ul:not(:has(> li > ul)):has(> li:nth-child(3)) { grid-template-columns: 1fr; margin-left: 8px; padding-left: 14px; }
}

/* Organization structure levels and drag-and-drop */
#orgRoles .or-node.lv-lead { background: linear-gradient(135deg, var(--navy), var(--navy2)); border-color: var(--gold); border-left-color: var(--gold); }
#orgRoles .or-node.lv-div { background: var(--navy); border-left-color: var(--gold); }
#orgRoles .or-node.lv-dept { background: var(--navy2); border-color: var(--navy2); border-left-color: color-mix(in srgb, var(--gold) 70%, #fff); }
#orgRoles .or-node.lv-team { background: var(--gold-soft); color: var(--ink); border-color: var(--line); border-left-color: var(--gold); }
#orgRoles .or-node.lv-team small, #orgRoles .or-node.lv-team span { color: var(--muted); }
#orgRoles .or-node[draggable="true"] { cursor: grab; }
#orgRoles .or-node.dragging { opacity: .45; }
#orgRoles .or-node.drop-ok { outline: 3px dashed var(--gold); outline-offset: 3px; transform: scale(1.03); transition: transform .1s; }

/* ---------- Org chart (cards): leadership on top, departments in wrapping columns, teams and people inside ---------- */
#orgRoles .oc-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white, #fff); }
#orgRoles .oc-seg button { border: 0; background: none; padding: 8px 14px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
#orgRoles .oc-seg button.on { background: var(--navy); color: #fff; }
#orgRoles .oc-tools { flex-wrap: wrap; gap: 8px; }
#orgRoles .oc-search { flex: 1 1 240px; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
#orgRoles .oc-zoom { display: inline-flex; gap: 4px; }
#orgRoles .oc-zoom .btn { min-width: 36px; padding: 8px 10px; }
#orgRoles .oc-wrap { padding: 18px; overflow: auto; background: color-mix(in srgb, var(--paper, #f4f6f8) 70%, #fff); }
#orgRoles .oc-canvas { min-width: 0; }
#orgRoles .oc-label { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink, var(--muted)); text-align: center; }
#orgRoles .oc-lead { display: flex; flex-direction: column; align-items: center; }
#orgRoles .oc-lead-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
#orgRoles .oc-lead-row .oc-person { border: 2px solid var(--gold); background: linear-gradient(135deg, var(--navy), var(--navy2, var(--navy))); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--navy) 28%, transparent); }
#orgRoles .oc-lead-row .oc-person small, #orgRoles .oc-lead-row .oc-person .oc-role { color: #ffffffc8; }
#orgRoles .oc-lead-row .oc-av { background: var(--gold); color: var(--navy); }
#orgRoles .oc-stem { width: 2px; height: 22px; margin: 0 auto; background: var(--line); }
#orgRoles .oc-body { border-top: 2px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 18px; }
#orgRoles .oc-lead + .oc-stem + .oc-body { border-top-left-radius: 0; }
#orgRoles .oc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; align-items: start; }
#orgRoles .oc-div { display: flex; flex-direction: column; gap: 10px; }
#orgRoles .oc-div-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--white, #fff); border: 1px solid var(--line); border-left: 4px solid var(--gold); }
#orgRoles .oc-dept { background: var(--white, #fff); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px #0d1b2a12; min-width: 0; transition: opacity .15s; }
#orgRoles .oc-dept-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #fff; }
#orgRoles .oc-dept-head[draggable="true"] { cursor: grab; }
#orgRoles .oc-dept-head small { color: #ffffffcc; }
#orgRoles .oc-dept-body { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
#orgRoles .oc-txt { display: grid; gap: 1px; min-width: 0; flex: 1; text-align: left; }
#orgRoles .oc-txt strong { font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#orgRoles .oc-txt small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#orgRoles .oc-tog { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #ffffff33; color: inherit; font-weight: 800; cursor: pointer; }
#orgRoles .oc-div-head .oc-tog { background: var(--paper, #f4f6f8); color: var(--navy); }
#orgRoles .oc-person { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--white, #fff); color: var(--ink); font: inherit; cursor: pointer; text-align: left; transition: box-shadow .15s, border-color .15s, opacity .15s; }
#orgRoles .oc-person:hover { border-color: color-mix(in srgb, var(--navy) 35%, var(--line)); box-shadow: 0 4px 14px #0d1b2a1a; }
#orgRoles .oc-person.big { padding: 9px 11px; }
#orgRoles .oc-lead-row .oc-person { width: auto; min-width: 230px; max-width: 300px; }
#orgRoles .oc-person.me { box-shadow: 0 0 0 2px var(--gold-soft, #f7eedb); border-color: var(--gold); }
#orgRoles .oc-person.hit { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent); }
#orgRoles .oc-person[draggable="true"] { cursor: grab; }
#orgRoles .oc-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--navy); }
#orgRoles .oc-person.big .oc-av { width: 40px; height: 40px; font-size: 14px; }
#orgRoles .oc-role { flex: none; font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: var(--gold-soft, #f7eedb); color: var(--accent-ink, #7a5a12); }
#orgRoles .oc-team { border-radius: 10px; background: var(--paper, #f4f6f8); }
#orgRoles .oc-team-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
#orgRoles .oc-ico { flex: none; font-size: 9px; letter-spacing: -2px; }
#orgRoles .oc-chev { flex: none; color: var(--muted); font-size: 12px; }
#orgRoles .oc-members { display: flex; flex-direction: column; gap: 5px; padding: 0 7px 8px; }
#orgRoles .oc-direct { display: flex; flex-direction: column; gap: 5px; }
#orgRoles .oc-direct .oc-label { text-align: left; margin: 4px 0 2px; }
#orgRoles .oc-nohead { margin: 0; padding: 6px 2px; }
#orgRoles .oc-loose { max-width: 360px; }
#orgRoles .dim { opacity: .38; }
#orgRoles .oc-sum { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); }
#orgRoles .oc-sum span { padding: 6px 12px; border-radius: 999px; background: var(--white, #fff); border: 1px solid var(--line); }
#orgRoles .oc-sum b { color: var(--ink); }
#orgRoles .oc-dept.drop-ok, #orgRoles .oc-team.drop-ok, #orgRoles .oc-div.drop-ok { outline: 3px dashed var(--gold); outline-offset: 2px; }
@media (max-width: 720px) {
  #orgRoles .oc-wrap { padding: 10px; }
  #orgRoles .oc-grid { grid-template-columns: 1fr; }
  #orgRoles .oc-lead-row .oc-person { min-width: 0; max-width: none; width: 100%; }
  #orgRoles .oc-zoom { display: none; }
}

#orgRoles .oc-dept-head .oc-txt small { color: #ffffffd0; }
#orgRoles .oc-lead-row .oc-role { background: #ffffff26; color: #fff; }
#orgRoles .oc-divgrid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
#orgRoles .oc-stack { display: flex; flex-direction: column; gap: 10px; }
#orgRoles .oc-chev { font-size: 14px; }
#orgRoles .oc-loose { max-width: none; }
