/* ConstructNav employee access — managed company identity with legacy fallback */

.cn-user-access-enabled>.avatar,
.cn-user-access-enabled>.user,
.cn-user-access-enabled>span{
  display:none!important;
}

.cn-user-switcher{
  position:relative;
  display:grid;
  grid-template-columns:34px minmax(86px,auto) 18px;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:4px 8px;
  border:1px solid #d5dee7;
  border-radius:9px;
  background:#fff;
  color:#122c46;
}

.cn-user-switch-avatar{
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border-radius:50%;
  background:#d8a43a;
  color:#071b31;
  font-size:11px;
  font-weight:900;
  letter-spacing:.03em;
}

.cn-user-switch-copy{
  display:grid;
  min-width:0;
  line-height:1.08;
}

.cn-user-switch-copy strong{
  max-width:145px;
  overflow:hidden;
  color:#112d49;
  font-size:12px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.cn-user-switch-copy small{
  max-width:145px;
  margin-top:3px;
  overflow:hidden;
  color:#728195;
  font-size:10px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.cn-user-switcher select{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  opacity:0;
  cursor:pointer;
}

.cn-user-switcher:after{
  content:"⌄";
  grid-column:3;
  grid-row:1;
  color:#52677a;
  font-size:13px;
  pointer-events:none;
}

.cn-user-switcher:hover{
  border-color:#9fb5c8;
  background:#f7fafc;
}

.cn-user-switcher.cn-managed-user{
  display:block;
  min-width:286px;
  padding:0;
  overflow:hidden;
}

.cn-managed-account-button{
  display:grid;
  grid-template-columns:34px minmax(86px,1fr) auto 18px;
  align-items:center;
  gap:8px;
  width:100%;
  min-height:42px;
  padding:4px 8px;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
}

.cn-managed-account-button:hover{
  background:#f7fafc;
}

.cn-managed-account-button:focus-visible{
  outline:3px solid rgba(23,63,101,.28);
  outline-offset:-3px;
}

.cn-managed-account-label{
  padding:6px 8px;
  border:1px solid #b9c9d7;
  border-radius:7px;
  background:#f4f8fb;
  color:#173f65;
  font-size:10px;
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
}

.cn-managed-account-caret{
  color:#52677a;
  font-size:13px;
  text-align:center;
}

.cn-user-switcher.cn-managed-user:after{
  content:none;
}

.cn-user-access-card{
  grid-column:1/-1;
}

.cn-user-access-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}

.cn-user-access-head h3{
  margin:0 0 4px;
}

.cn-user-access-head p{
  margin:0;
}

.cn-user-prototype-note{
  margin:0 0 14px;
  padding:11px 13px;
  border:1px solid #d4bc82;
  border-radius:8px;
  background:#fff8e8;
  color:#624b16;
  font-size:12px;
  line-height:1.45;
}

.cn-user-table-wrap{
  overflow:auto;
}

.cn-user-table{
  width:100%;
  border-collapse:collapse;
}

.cn-user-table th{
  padding:9px 10px;
  border-bottom:1px solid #dfe6ed;
  color:#637386;
  font-size:10px;
  font-weight:850;
  letter-spacing:.05em;
  text-align:left;
  text-transform:uppercase;
}

.cn-user-table td{
  padding:11px 10px;
  border-bottom:1px solid #edf1f4;
  vertical-align:middle;
}

.cn-user-table tr:last-child td{
  border-bottom:0;
}

.cn-user-table tr.inactive{
  opacity:.58;
}

.cn-user-person{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:175px;
}

.cn-user-person>span{
  display:grid;
  place-items:center;
  flex:0 0 34px;
  width:34px;
  height:34px;
  border-radius:50%;
  background:#173f65;
  color:#fff;
  font-size:11px;
  font-weight:900;
}

.cn-user-person>div{
  display:grid;
  gap:2px;
}

.cn-user-person small,
.cn-user-title{
  display:block;
  color:#768697;
  font-size:10px;
}

.cn-user-functions{
  max-width:440px;
  color:#526476;
  font-size:11px;
  line-height:1.4;
}

.cn-current-user-pill{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 9px;
  border-radius:999px;
  background:#edf7f1;
  color:#21613d;
  font-size:10px;
  font-weight:850;
  white-space:nowrap;
}

.cn-user-dialog{
  width:min(920px,calc(100vw - 28px));
  max-width:920px;
  max-height:calc(100dvh - 28px);
  padding:0;
  border:0;
  border-radius:12px;
  box-shadow:0 24px 70px rgba(4,24,43,.35);
}

.cn-user-dialog::backdrop{
  background:rgba(4,24,43,.55);
}

.cn-user-dialog-head>div{
  display:grid;
  gap:3px;
}

.cn-user-dialog-head small{
  color:#738395;
  font-size:11px;
  font-weight:500;
}

.cn-user-form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.cn-user-form-grid label{
  display:block;
  margin:0 0 5px;
  color:#43576b;
  font-size:11px;
  font-weight:800;
}

.cn-user-form-grid input,
.cn-user-form-grid select{
  width:100%;
  box-sizing:border-box;
}

.cn-user-record-access{
  display:flex!important;
  align-items:flex-start;
  gap:10px;
  min-height:74px;
  box-sizing:border-box;
  padding:12px;
  border:1px solid #dce5ed;
  border-radius:9px;
  background:#f7fafc;
  cursor:pointer;
}

.cn-user-record-access input{
  flex:0 0 auto;
  width:17px;
  height:17px;
  margin:2px 0 0;
}

.cn-user-record-access span{
  display:grid;
  gap:4px;
}

.cn-user-record-access strong{
  color:#31485d;
  font-size:11px;
}

.cn-user-record-access small{
  color:#748394;
  font-size:10px;
  line-height:1.35;
}

.cn-user-permission-head{
  display:flex;
  justify-content:space-between;
  margin:18px 0 9px;
}

.cn-user-permission-head>div{
  display:grid;
  gap:2px;
}

.cn-user-permission-head small{
  color:#748394;
  font-size:10px;
}

.cn-user-permission-groups{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.cn-user-permission-group{
  min-width:0;
  margin:0;
  padding:10px;
  border:1px solid #dce5ed;
  border-radius:9px;
}

.cn-user-permission-group legend{
  padding:0 5px;
  color:#173956;
  font-size:10px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.cn-user-permission-group>div{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
}

.cn-user-permission{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  padding:8px;
  border:1px solid #e3e9ee;
  border-radius:7px;
  background:#fff;
  cursor:pointer;
}

.cn-user-permission.required{
  border-color:#b9dbc7;
  background:#f0f8f3;
  cursor:default;
}

.cn-user-permission input{
  flex:0 0 auto;
  width:16px;
  height:16px;
  margin:0;
}

.cn-user-permission span{
  display:grid;
  min-width:0;
  gap:2px;
}

.cn-user-permission strong{
  overflow:hidden;
  color:#31485d;
  font-size:11px;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.cn-user-permission small{
  color:#39835a;
  font-size:9px;
  font-weight:750;
}

.cn-user-dialog-foot{
  display:flex;
  align-items:center;
}

.cn-user-dialog-spacer{
  flex:1;
}

.view.cn-access-denied{
  display:none!important;
}

#nav button.cn-access-denied,
#nav .nav-label[hidden]{
  display:none!important;
}

@media(max-width:900px){
  .cn-user-switch-copy{
    display:none;
  }
  .cn-user-switcher{
    grid-template-columns:34px 16px;
    min-width:58px;
  }
  .cn-user-switcher.cn-managed-user{
    min-width:176px;
  }
  .cn-managed-account-button{
    grid-template-columns:34px auto 18px;
  }
  .cn-managed-account-label{
    grid-column:2;
  }
  .cn-managed-account-caret{
    grid-column:3;
  }
  .cn-user-switcher:after{
    grid-column:2;
  }
}

@media(max-width:760px){
  .cn-user-switcher{
    display:none!important;
  }
  .cn-user-access-head{
    align-items:stretch;
    flex-direction:column;
  }
  .cn-user-access-head .btn{
    width:100%;
  }
  .cn-user-form-grid,
  .cn-user-permission-groups{
    grid-template-columns:1fr;
  }
  .cn-user-permission-group>div{
    grid-template-columns:1fr;
  }
  .cn-user-dialog-foot{
    flex-wrap:wrap;
  }
  .cn-user-dialog-spacer{
    display:none;
  }
  .cn-user-dialog-foot .btn{
    flex:1;
  }
}
